Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Co-authored-by: Albert Zeyer <[email protected]>
  • Loading branch information
christophmluscher and albertz authored Dec 19, 2024
1 parent afd5481 commit daa9484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion i6_models/losses/nce.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def forward(self, data: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
samples = self.noise_distribution_sampler.sample(self.num_samples).cuda()

# log-probabilities for the noise distribution k * q(w|h)
ws = torch.log(torch.Tensor([self.num_samples]))
ws = torch.log(torch.tensor(float(self.num_samples)))
sampled_prob = ws + self.noise_distribution_sampler.log_prob(samples) # [num_samples]
true_sample_prob = ws + self.noise_distribution_sampler.log_prob(target) # [B x T]

Expand Down

0 comments on commit daa9484

Please sign in to comment.