Skip to content

Commit

Permalink
fix multibook loss
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct committed Aug 16, 2024
1 parent 816ba6c commit d95a0bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wenet/ssl/bestrq/bestrq_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def _stack_features(self, input: torch.Tensor,

def _compute_loss(self, input: torch.Tensor, target: torch.Tensor,
mask: torch.Tensor) -> torch.Tensor:
logits = input.contiguous().view(-1, input.size(-1))
logits = input.transpose(1, 2).contiguous().view(-1, input.size(-1))
loss = torch.nn.functional.cross_entropy(
logits,
target.contiguous().view(-1),
Expand Down

0 comments on commit d95a0bf

Please sign in to comment.