All Classes Files Functions Friends Pages
loss.h File Reference
Include dependency graph for loss.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Variable MSELoss (const std::vector< Variable > &predictions, const std::vector< double > &targets)
 

Function Documentation

◆ MSELoss()

Variable MSELoss ( const std::vector< Variable > &  predictions,
const std::vector< double > &  targets 
)

Calculates the Mean Squared Error (MSE) loss between a vector of predictions and a vector of targets.

Parameters
predictionsThe vector of predicted values.
targetsThe vector of target values.
Returns
The calculated MSE loss as a Variable.