Skip to content

Commit

Permalink
update notebook, bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janfb committed Dec 12, 2024
1 parent b2fe636 commit 074efa0
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 99 deletions.
4 changes: 2 additions & 2 deletions sbi/inference/potentials/likelihood_based_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ def conditioned_potential(
theta: Tensor, x_o: Optional[Tensor] = None, track_gradients: bool = True
) -> Tensor:
assert (

Check warning on line 136 in sbi/inference/potentials/likelihood_based_potential.py

View check run for this annotation

Codecov / codecov/patch

sbi/inference/potentials/likelihood_based_potential.py#L136

Added line #L136 was not covered by tests
len(dims_to_sample) == theta.shape[1] - condition.shape[1]
len(dims_to_sample) == theta.shape[1]
), "dims_to_sample must match the number of parameters to sample."
theta_without_condition = theta[:, dims_to_sample]

Check warning on line 139 in sbi/inference/potentials/likelihood_based_potential.py

View check run for this annotation

Codecov / codecov/patch

sbi/inference/potentials/likelihood_based_potential.py#L139

Added line #L139 was not covered by tests

return _log_likelihood_with_iid_condition(

Check warning on line 141 in sbi/inference/potentials/likelihood_based_potential.py

View check run for this annotation

Codecov / codecov/patch

sbi/inference/potentials/likelihood_based_potential.py#L141

Added line #L141 was not covered by tests
x=x_o or self.x_o,
x=x_o if x_o is not None else self.x_o,
theta_without_condition=theta_without_condition,
condition=condition,
estimator=self.likelihood_estimator,
Expand Down
Loading

0 comments on commit 074efa0

Please sign in to comment.