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>;
116 #include "binary_cross_entropy_loss_impl.hpp" void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
BCELoss(const double eps=1e-10, const bool reduction=true)
Create the BinaryCrossEntropyLoss object.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool Reduction() const
Get the reduction.
bool & Reduction()
Set the reduction.
OutputDataType & OutputParameter() const
Get the output parameter.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the cross-entropy function.
OutputDataType & OutputParameter()
Modify the output parameter.
double Eps() const
Get the epsilon.
The binary-cross-entropy performance function measures the Binary Cross Entropy between the target an...
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
double & Eps()
Modify the epsilon.