tabensemb.model.AbstractNN.loss_fn#
method
- AbstractNN.loss_fn(y_pred, y_true, *data, **kwargs)[source]#
User defined loss function.
- Parameters:
- y_true:
The ground truth.
- y_pred:
The predictions from the model (from
forward()and afterbefore_loss_fn()).- *data:
Tensors of continuous data and derived unstacked data.
- **kwargs:
Parameters to train the model returned by
AbstractModel._get_params(). It contains all arguments inAbstractModel._initial_values().
- Returns:
- torch.Tensor
A torch-like loss.
Notes
Other attributes in
selfcan also be used to calculate loss values.