Skip to content

Commit

Permalink
discrepancy update works, testing with models
Browse files Browse the repository at this point in the history
  • Loading branch information
daneschi committed Nov 7, 2023
1 parent 4864f30 commit 70a9e4e
Show file tree
Hide file tree
Showing 2 changed files with 403 additions and 2 deletions.
3 changes: 1 addition & 2 deletions linfa/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def train(self, nf, optimizer, iteration, log, sampling=True, t=1):
print('Invalid type of surrogate model')
exit(-1)
if(go_on):
# Update Surrogate Model
if(self.surrogate_type == 'surrogate'):
xk0 = xk[:self.true_data_num, :].data.clone()
self.surrogate.update(xk0, max_iters=self.surr_upd_it)
Expand All @@ -312,8 +313,6 @@ def train(self, nf, optimizer, iteration, log, sampling=True, t=1):
else:
print('Invalid type of surrogate model')
exit(-1)
# Update Surrogate Model


# Free energy bound
loss = (- torch.sum(sum_log_abs_det_jacobians, 1) - t * self.model_logdensity(xk)).mean()
Expand Down
Loading

0 comments on commit 70a9e4e

Please sign in to comment.