Skip to content

Commit

Permalink
test for factual log probs
Browse files Browse the repository at this point in the history
  • Loading branch information
PoorvaGarg committed Aug 6, 2024
1 parent 4058660 commit 34d0faf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/explainable/test_handlers_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def model_ce():
nd["__factor_consequent"]["fn"].log_factor, IndexSet(**{"w": {2}})
)

assert torch.equal(eq_neq_log_probs_fact, torch.zeros(eq_neq_log_probs_fact.shape))
assert eq_neq_log_probs_nec.shape == consequent_suff.shape
assert torch.equal(eq_neq_log_probs_suff, dist.Normal(0.0, .1).log_prob(consequent_suff - torch.tensor(.01)))
assert eq_neq_log_probs_nec.sum().exp() == 0
Expand Down

0 comments on commit 34d0faf

Please sign in to comment.