Skip to content

Commit

Permalink
bugfix spike_slab log_prob
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinzz committed Jun 1, 2022
1 parent c48b2c3 commit 88aad94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sparsecoding/priors/spike_slab.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def log_prob(
log_prob[slab_mask] = (
torch.log(torch.tensor(1. - self.p_spike))
- torch.log(torch.tensor(self.scale))
- sample[slab_mask] / self.scale
- torch.abs(sample[slab_mask]) / self.scale
)
if self.positive_only:
log_prob[sample < 0.] = -torch.inf
Expand Down

0 comments on commit 88aad94

Please sign in to comment.