[−][src]Trait neuro::losses::Loss
Defines the behaviors of a loss function.
Required methods
fn id(&self) -> u64
Returns a unique identifier.
fn eval(&self, y_pred: &Tensor, y_true: &Tensor) -> PrimitiveType
Computes the value of the loss function from the predicted and true labels.
fn grad(&self, y_pred: &Tensor, y_true: &Tensor) -> Tensor
Computes the gradient of the loss function from the predicted and true labels.