Skip to content

Commit

Permalink
Fix wrong softmax projection on probs/logits (John Leland)
Browse files Browse the repository at this point in the history
  • Loading branch information
braun-steven committed Jun 17, 2024
1 parent 0213fe0 commit 29fb588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simple_einet/layers/distributions/abstract_leaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def dist_sample(distribution: dist.Distribution, ctx: SamplingContext = None) ->
elif type(distribution) == CustomNormal:
distribution = CustomNormal(mu=distribution.mu, sigma=distribution.sigma / ctx.temperature_leaves)
elif type(distribution) == dist.Categorical:
distribution = dist.Categorical(logits=F.log_softmax(distribution.probs / ctx.temperature_leaves))
distribution = dist.Categorical(logits=F.log_softmax(distribution.logits / ctx.temperature_leaves))
samples = distribution.sample(sample_shape=(ctx.num_samples,)).float()

assert (
Expand Down

0 comments on commit 29fb588

Please sign in to comment.