File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,8 +159,17 @@ def call(self, parameters):
159159 # Get instance from model
160160 instance = self .model .instance_from_vector (vector = parameters )
161161
162- # Evaluate log likelihood (must be side-effect free and exception-free)
163- log_likelihood = self .analysis .log_likelihood_function (instance = instance )
162+ if self ._xp .__name__ .startswith ("jax" ):
163+
164+ # Evaluate log likelihood (must be side-effect free and exception-free)
165+ log_likelihood = self .analysis .log_likelihood_function (instance = instance )
166+
167+ else :
168+
169+ try :
170+ log_likelihood = self .analysis .log_likelihood_function (instance = instance )
171+ except exc .FitException :
172+ return self .resample_figure_of_merit
164173
165174 # Penalize NaNs in the log-likelihood
166175 log_likelihood = self ._xp .where (self ._xp .isnan (log_likelihood ), self .resample_figure_of_merit , log_likelihood )
You can’t perform that action at this time.
0 commit comments