Closed asr-pub closed 1 year ago
Hello, I have a question about the CE loss, Why use the sum mode of CE loss ?
sum
def forward( self, x: torch.Tensor, x_lens: torch.Tensor, y: Union[torch.Tensor, PromptedFeatures], y_lens: Union[torch.Tensor, PromptedFeatures], reduction: str = "sum", train_stage: int = 0, **kwargs, ) -> Tuple[torch.Tensor, Union[torch.Tensor, None]]: ... total_loss = F.cross_entropy(logits, targets, reduction=reduction) ...
@asr-pub you can try mean
mean
Hello, I have a question about the CE loss, Why use the
sum
mode of CE loss ?