Deep Learning Algorithm Implementations 1.0.0
C++ implementations of fundamental deep learning algorithms
Loading...
Searching...
No Matches
dl::loss::AutogradLoss< T > Class Template Referenceabstract

Base class for autograd-compatible loss functions. More...

#include <losses.hpp>

Inheritance diagram for dl::loss::AutogradLoss< T >:

Public Member Functions

virtual ~AutogradLoss ()=default
 
virtual Variable< T > forward (const Variable< T > &predictions, const Variable< T > &targets)=0
 Compute loss between predictions and targets.
 
Variable< T > operator() (const Variable< T > &predictions, const Variable< T > &targets)
 Convenience operator for computing loss.
 

Detailed Description

template<typename T>
class dl::loss::AutogradLoss< T >

Base class for autograd-compatible loss functions.

Definition at line 27 of file losses.hpp.

Constructor & Destructor Documentation

◆ ~AutogradLoss()

template<typename T >
virtual dl::loss::AutogradLoss< T >::~AutogradLoss ( )
virtualdefault

Member Function Documentation

◆ forward()

template<typename T >
virtual Variable< T > dl::loss::AutogradLoss< T >::forward ( const Variable< T > &  predictions,
const Variable< T > &  targets 
)
pure virtual

Compute loss between predictions and targets.

Parameters
predictionsModel predictions
targetsGround truth targets
Returns
Loss value as a Variable (scalar)

Implemented in dl::loss::MSELoss< T >, dl::loss::CrossEntropyLoss< T >, dl::loss::BCELoss< T >, dl::loss::BCEWithLogitsLoss< T >, dl::loss::HingeLoss< T >, and dl::loss::HuberLoss< T >.

◆ operator()()

template<typename T >
Variable< T > dl::loss::AutogradLoss< T >::operator() ( const Variable< T > &  predictions,
const Variable< T > &  targets 
)
inline

Convenience operator for computing loss.

Definition at line 42 of file losses.hpp.


The documentation for this class was generated from the following file: