TorchLean API

NN.Proofs.Autograd.Tape.Nodes.Losses.MSE

Mean-Squared Error #

Tape node and Fréchet derivative proof for scalar mean-squared error.

noncomputable def Proofs.Autograd.TapeNodes.mseLoss {Γ : List Spec.Shape} {s : Spec.Shape} (yhat target : Idx Γ s) :

Mean-squared-error loss node: c * ‖yhat - target‖^2, with c = 1 / Spec.meanDenom s.

For nonempty shapes this is the usual 1 / Spec.Shape.size s. For the empty shape case, the scalar loss API is totalized with denominator 1, matching Spec.mseSpec and the IR evaluator.

Instances For
    noncomputable def Proofs.Autograd.TapeNodes.mseLossFderiv {Γ : List Spec.Shape} {s : Spec.Shape} (yhat target : Idx Γ s) :

    NodeFDerivCorrect for mse_loss.

    Instances For