Class MSELoss

java.lang.Object
io.github.kirstenali.deepj.loss.MSELoss
All Implemented Interfaces:
LossFunction

public class MSELoss extends Object implements LossFunction
Mean-Squared-Error loss.

Reduction convention: the loss is averaged over every element (rows × cols), not just over rows. Consequently the gradient is 2·(predicted − actual) / (rows·cols). This keeps the loss scale independent of the feature dimension. If a sum reduction or a per-row mean is required, scale the result accordingly.