vis4d.op.loss.reducer
Definitions of loss reducers.
Loss reducers are usually used as the last step in loss computation to average or sum the loss maps from dense predictions or object detections.
Functions
|
Make no change to the loss. |
|
Average the loss tensor values to a single value. |
|
Sum the loss tensor values to a single value. |
Classes
|
A loss reducer to calculated weighted sum loss. |
- mean_loss(loss)[source]
Average the loss tensor values to a single value.
- Parameters:
loss (Tensor) – Input multi-dimentional tensor.
- Returns:
Tensor containing a single loss value.
- Return type:
Tensor
- sum_loss(loss)[source]
Sum the loss tensor values to a single value.
- Parameters:
loss (Tensor) – Input multi-dimentional tensor.
- Returns:
Tensor containing a single loss value.
- Return type:
Tensor
- class SumWeightedLoss(weight, avg_factor)[source]
A loss reducer to calculated weighted sum loss.