12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTIONS_CROSS_ENTROPY_ERROR_HPP 13 #define MLPACK_METHODS_ANN_LOSS_FUNCTIONS_CROSS_ENTROPY_ERROR_HPP 30 typename InputDataType = arma::mat,
31 typename OutputDataType = arma::mat
44 BCELoss(
const double eps = 1e-10,
const bool reduction =
true);
53 template<
typename PredictionType,
typename TargetType>
54 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
55 const TargetType& target);
65 template<
typename PredictionType,
typename TargetType,
typename LossType>
66 void Backward(
const PredictionType& prediction,
67 const TargetType& target,
76 double Eps()
const {
return eps; }
78 double&
Eps() {
return eps; }
88 template<
typename Archive>
89 void serialize(Archive& ar,
const uint32_t );
93 OutputDataType outputParameter;
106 typename InputDataType = arma::mat,
107 typename OutputDataType = arma::mat
110 InputDataType, OutputDataType>;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the cross-entropy function.
Definition: binary_cross_entropy_loss_impl.hpp:31
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Eps() const
Get the epsilon.
Definition: binary_cross_entropy_loss.hpp:76
BCELoss(const double eps=1e-10, const bool reduction=true)
Create the BinaryCrossEntropyLoss object.
Definition: binary_cross_entropy_loss_impl.hpp:22
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: binary_cross_entropy_loss_impl.hpp:58
bool & Reduction()
Set the reduction.
Definition: binary_cross_entropy_loss.hpp:83
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: binary_cross_entropy_loss.hpp:71
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: binary_cross_entropy_loss_impl.hpp:46
double & Eps()
Modify the epsilon.
Definition: binary_cross_entropy_loss.hpp:78
The binary-cross-entropy performance function measures the Binary Cross Entropy between the target an...
Definition: binary_cross_entropy_loss.hpp:33
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: binary_cross_entropy_loss.hpp:73
bool Reduction() const
Get the reduction.
Definition: binary_cross_entropy_loss.hpp:81