Skip to content

Commit

Permalink
change var to var_inv
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnWangDataAnalyst committed Jan 11, 2024
1 parent dc52a35 commit 3d330e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions whobpyt/optimization/custom_cost_JR.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def loss(self, simData: dict, empData: torch.Tensor):

for var_name in variables_p:
var = getattr(model.params, var_name)
if var.fit_par and \
if var.fit_hyper and \
var_name not in exclude_param:
loss_prior.append(torch.sum(( m(var.prior_var)) * \
loss_prior.append(torch.sum(( m(var.prior_var_inv)) * \
(m(var.val) - m(var.prior_mean)) ** 2) \
+ torch.sum(-torch.log( m(var.prior_var))))
+ torch.sum(-torch.log( m(var.prior_var_inv))))

# total loss
loss = 0.1 * w_cost * loss_main + 1 * sum(loss_prior) + 1 * loss_EI
Expand Down

0 comments on commit 3d330e5

Please sign in to comment.