Class: GRX::Loss::MAELoss
- Inherits:
-
Object
- Object
- GRX::Loss::MAELoss
- Defined in:
- lib/grx/loss.rb
Overview
MAELoss — Mean Absolute Error L = mean(|pred - target|)
Instance Method Summary collapse
Instance Method Details
#call(pred, target) ⇒ Object
21 22 23 24 |
# File 'lib/grx/loss.rb', line 21 def call(pred, target) raise ShapeError, "Shapes incompatibles" if pred.shape != target.shape (pred - target).abs.mean end |