Common objective (loss) functions
Wrappers¶
Below we define several wrappers for well known losses that are defined and implemented in the Pytorch library. The main idea is that we need to flatten our prediction before we pass them accordingly to the chosen loss function.
The FlatLoss class creates a callable that will do whatever the function that we pass would do, but with flattened input and target before the operation.