Apache Singa
A General Distributed Deep Learning Library
|
MSE is for mean squared error or squared euclidean distance. More...
#include <loss.h>
Public Member Functions | |
Tensor | Forward (int flag, const Tensor &prediction, const Tensor &target) override |
Compute the loss values for each sample/instance given the prediction and the target, which is 0.5/||prediction-target||^2 Users can call Average(const Tensor&) to get the average loss value over all samples in the batch. More... | |
Tensor | Backward () override |
Compute the gradients of the loss values w.r.t. More... | |
Public Member Functions inherited from singa::Loss | |
void | Setup (const string &conf) |
virtual void | ToDevice (std::shared_ptr< Device > device) |
virtual void | Setup (const LossConf &conf) |
Set meta fields from user configurations. | |
float | Evaluate (int flag, const Tensor &prediction, const Tensor &target) |
Average loss values for all samples in the mini-batch It calls Forward() internally. More... | |
MSE is for mean squared error or squared euclidean distance.
|
overridevirtual |
Compute the gradients of the loss values w.r.t.
the prediction, which is (prediction-target)/batchsize
Implements singa::Loss.
|
overridevirtual |
Compute the loss values for each sample/instance given the prediction and the target, which is 0.5/||prediction-target||^2 Users can call Average(const Tensor&) to get the average loss value over all samples in the batch.
Implements singa::Loss.