Skip to content

Commit

Permalink
rm expensive lines in estimator related to chain log
Browse files Browse the repository at this point in the history
  • Loading branch information
JBjoernskov committed Jan 15, 2024
1 parent 596a6d0 commit 045cc22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion twin4build/estimator/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def run_emcee_estimation(self,
x0_start = x0_start.reshape((n_temperature, n_walkers, ndim))

elif walker_initialization=="hypercube":
x0_start = np.random.uniform(low=self.x0-1e-5, high=self.x0+1e-5, size=(n_temperature, n_walkers, ndim))
r = 1e-5
x0_start = np.random.uniform(low=self.x0-r, high=self.x0+r, size=(n_temperature, n_walkers, ndim))
lb = np.resize(self.lb,(x0_start.shape))
ub = np.resize(self.ub,(x0_start.shape))
x0_start[x0_start<self.lb] = lb[x0_start<self.lb]
Expand Down
8 changes: 5 additions & 3 deletions twin4build/simulator/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def _sim_func_gaussian_process(self, model, theta, stepSize, startTime, endTime,
except FMICallException as inst:
return None

return (y, y_noise, y_model)
return (y, y_model, y_noise)

def _sim_func_wrapped(self, args):
return self._sim_func(*args)
Expand Down Expand Up @@ -445,8 +445,10 @@ def run_emcee_inference(self, model, parameter_chain, targetParameters, targetMe
# standardDeviation = np.array([el["standardDeviation"] for el in targetMeasuringDevices.values()])
# y_w_obs_error = y# + np.random.normal(0, standardDeviation, size=y.shape)
for col in range(len(targetMeasuringDevices)):
predictions_noise[col].append(y[1][:,col])
predictions_model[col].append(y[2][:,col])
if assume_uncorrelated_noise==False:
predictions_noise[col].append(y[2][:,col])

predictions_model[col].append(y[1][:,col])
predictions[col].append(y[0][:,col])

intervals = []
Expand Down

0 comments on commit 045cc22

Please sign in to comment.