Skip to content

Conversation

@micheles
Copy link
Contributor

@micheles micheles commented Oct 12, 2023

See #9073.
For an historical accident the random generator was reset for each gsim, now instead there is a single random generator for all gsims. This is consistent with how it is done in the ConditionedGmfComputer and will allow me to remove some duplication between the two computers.

@micheles micheles added this to the Engine 3.18.0 milestone Oct 12, 2023
@micheles micheles merged commit 80adbea into master Oct 12, 2023
@micheles micheles deleted the random_seed branch October 12, 2023 07:46
@J-Cohen-Gabor
Copy link

The bug appears to still be present in the 3.18 release (I generated a similar plot breaking down the random values by GMPE as in the original issue). While the random seed has been broken out by GMPE, the compute_all function loops through the rupture which is actually what links the seed. A structural fix would require changing the seed in compute_all to something entirely different - a simple fix is to simply change the gmf seed by 1

def compute_all(self, mean_stds, max_iml=None,
                    cmon=Monitor(), umon=Monitor()):
        """
        :returns: DataFrame with fields eid, rlz, sid, gmv_X, ...
        """
        self.init_eid_rlz_sig_eps()
        rng = numpy.random.default_rng(self.seed + 1) #simply add 1 to the code here fixes the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants