Fork me on GitHub
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood

Module mean_square_error_loss

Types

MSELoss[TT] = ref object of Loss[TT]
  cache: Variable[TT]
  Source Edit

Procs

proc mse_loss[TT](input: Variable[TT]; target: TT): Variable[TT]
Mean square error loss function.
Input:
  • An input variable of predicted values of shape [batch_size, features]
  • The ground truth of the same shape
  Source Edit

Methods

method forward[TT](self: MSELoss[TT]; input: Variable[TT]; target: TT): Variable[TT] {.
inline, locks: 0
.}
  Source Edit
method backward[TT](self: MSELoss[TT]; gradient: TT): SmallDiffs[TT] {.
noInit, inline, locks: 0
.}
  Source Edit