12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_BIAS_ERROR_IMPL_HPP 13 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_BIAS_ERROR_IMPL_HPP 22 template<
typename InputDataType,
typename OutputDataType>
28 template<
typename InputDataType,
typename OutputDataType>
29 template<
typename PredictionType,
typename TargetType>
30 typename PredictionType::elem_type
32 const PredictionType& prediction,
33 const TargetType& target)
35 return arma::accu(target - prediction) / target.n_cols;
38 template<
typename InputDataType,
typename OutputDataType>
39 template<
typename PredictionType,
typename TargetType,
typename LossType>
41 const PredictionType& prediction,
45 loss.set_size(arma::size(prediction));
49 template<
typename InputDataType,
typename OutputDataType>
50 template<
typename Archive>
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: mean_bias_error_impl.hpp:40
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: mean_bias_error_impl.hpp:51
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
MeanBiasError()
Create the MeanBiasError object.
Definition: mean_bias_error_impl.hpp:23
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the mean bias error function.
Definition: mean_bias_error_impl.hpp:31