torchcell.losses.logcosh.LogCoshLoss

class LogCoshLoss(reduction: str = 'mean')[source]

Bases: Module

Log-cosh loss: a smooth, outlier-robust alternative to MSE.

forward(input: Tensor, target: Tensor) → Tensor[source]

Return the log-cosh of the residual, reduced per self.reduction.