Add standardized comment about MatType.
This commit is contained in:
@@ -23,7 +23,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* Implementation of the Add layer. The Add module applies a bias term to the
|
||||
* incoming data.
|
||||
*
|
||||
* @tparam MatType Matrix type used as inputs, outputs, and weights.
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType>
|
||||
class AddType : public Layer<MatType>
|
||||
|
||||
@@ -40,10 +40,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class AlphaDropoutType : public Layer<MatType>
|
||||
|
||||
@@ -27,10 +27,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
*
|
||||
* After this layer is applied, the shape of the data will be a vector.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class ConcatenateType : public Layer<MatType>
|
||||
|
||||
@@ -62,10 +62,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* @tparam ForwardConvolutionRule Convolution to perform forward process.
|
||||
* @tparam BackwardConvolutionRule Convolution to perform backward process.
|
||||
* @tparam GradientConvolutionRule Convolution to calculate gradient.
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template <
|
||||
typename ForwardConvolutionRule = NaiveConvolution<ValidConvolution>,
|
||||
|
||||
@@ -43,11 +43,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class DropConnectType : public Layer<MatType>
|
||||
|
||||
@@ -41,11 +41,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class DropoutType : public Layer<MatType>
|
||||
|
||||
@@ -45,12 +45,8 @@ namespace ann {
|
||||
* Forward(), Backward() and Gradient(). The weights of the layers are tracked
|
||||
* in layer.Parameters().
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. Layers automatically cast
|
||||
* inputs to this type (default: arma::mat).
|
||||
* @tparam MatType The type of the layer's computation which also causes the
|
||||
* computations and output to also be in this type. The type also allows the
|
||||
* computation and weight type to differ from the input type
|
||||
* (default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class Layer
|
||||
|
||||
@@ -34,11 +34,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* \right.
|
||||
* @f}
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class LeakyReLUType : public Layer<MatType>
|
||||
|
||||
@@ -30,11 +30,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* must be either a vector or matrix. If the input is a matrix, then each column
|
||||
* is assumed to be an input sample of given batch.
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
* @tparam RegularizerType Type of the regularizer to be used (Default no
|
||||
* regularizer).
|
||||
*/
|
||||
|
||||
@@ -29,12 +29,10 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* Shape of input : (inSize * nPoints, batchSize)
|
||||
* Shape of output : (outSize * nPoints, batchSize)
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template <
|
||||
template<
|
||||
typename MatType = arma::mat,
|
||||
typename RegularizerType = NoRegularizer
|
||||
>
|
||||
|
||||
@@ -25,11 +25,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* Implementation of the LinearNoBias class. The LinearNoBias class represents a
|
||||
* single layer of a neural network.
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
* @tparam RegularizerType Type of the regularizer to be used (Default no
|
||||
* regularizer).
|
||||
*/
|
||||
|
||||
@@ -26,11 +26,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* (NegativeLogLikelihoodLayer), which expects that the input contains
|
||||
* log-probabilities for each class.
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template <typename MatType = arma::mat>
|
||||
class LogSoftMaxType : public Layer<MatType>
|
||||
|
||||
@@ -52,10 +52,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* \see FastLSTM for a faster LSTM version which combines the calculation of the
|
||||
* input, forget, output gates and hidden state in a single step.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class LSTMType : public RecurrentLayer<MatType>
|
||||
|
||||
@@ -52,10 +52,8 @@ class MaxPoolingRule
|
||||
/**
|
||||
* Implementation of the MaxPooling layer.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MaxPoolingType : public Layer<MatType>
|
||||
|
||||
@@ -25,6 +25,9 @@ namespace ann {
|
||||
* It's likely not very useful to use this layer directly; instead, this layer
|
||||
* is meant as a base class for use by other layers that must store and use
|
||||
* multiple layers.
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType>
|
||||
class MultiLayer : public Layer<MatType>
|
||||
|
||||
@@ -24,11 +24,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* Implementation of the NoisyLinear layer class. It represents a single
|
||||
* layer of a neural network, with parametric noise added to its weights.
|
||||
*
|
||||
* @tparam MatType The type of the layer's inputs. The layer automatically
|
||||
* cast inputs to this type (Default: arma::mat).
|
||||
* @tparam MatType The type of the computation which also causes the output
|
||||
* to also be in this type. The type also allows the computation and weight
|
||||
* type to differ from the input type (Default: arma::mat).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class NoisyLinearType : public Layer<MatType>
|
||||
|
||||
@@ -19,13 +19,11 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* Implementation of the Padding module class. The Padding module applies a bias term
|
||||
* to the incoming data.
|
||||
* Implementation of the Padding module class. The Padding module applies
|
||||
* (zero-valued) padding on the input data.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class PaddingType : public Layer<MatType>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of the Radial Basis Function layer. The RBFType class when use
|
||||
* with a non-linear activation function acts as a Radial Basis Function which
|
||||
@@ -38,10 +37,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
* @tparam Activation Type of the activation function (mlpack::ann::Gaussian).
|
||||
*/
|
||||
|
||||
|
||||
@@ -15,9 +15,13 @@
|
||||
namespace mlpack {
|
||||
namespace ann {
|
||||
|
||||
template<
|
||||
typename MatType = arma::mat
|
||||
>
|
||||
/**
|
||||
* TODO: comment
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class RecurrentLayer : public Layer<MatType>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -18,13 +18,11 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* The binary-cross-entropy performance function measures the
|
||||
* Binary Cross Entropy between the target and the output.
|
||||
* The binary-cross-entropy performance function measures the Binary Cross
|
||||
* Entropy between the target and the output.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class BCELossType
|
||||
|
||||
@@ -26,11 +26,9 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* f(x) = 1 - cos(x1, x2) , for y = 1
|
||||
* f(x) = max(0, cos(x1, x2) - margin) , for y = -1
|
||||
* @f}
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class CosineEmbeddingLossType
|
||||
|
||||
@@ -38,10 +38,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class DiceLossType
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The earth mover distance function measures the network's performance
|
||||
* according to the Kantorovich-Rubinstein duality approximation.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class EarthMoverDistanceType
|
||||
|
||||
@@ -23,10 +23,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The empty loss does nothing, letting the user calculate the loss outside
|
||||
* the model.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class EmptyLossType
|
||||
|
||||
@@ -24,10 +24,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The Hinge Embedding loss function is often used to compute the loss
|
||||
* between y_true and y_pred.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class HingeEmbeddingLossType
|
||||
|
||||
@@ -25,10 +25,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The hinge loss \f$l(y_true, y_pred)\f$ is defined as
|
||||
* \f$l(y_true, y_pred) = max(0, 1 - y_true*y_pred)\f$.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class HingeLossType
|
||||
|
||||
@@ -24,10 +24,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* and linear for large values, with equal values and slopes of the different
|
||||
* sections at the two points where \f$ |y - f(x)| = delta \f$.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class HuberLossType
|
||||
|
||||
@@ -33,10 +33,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class KLDivergenceType
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The L1 loss is a loss function that measures the mean absolute error (MAE)
|
||||
* between each element in the input x and target y
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class L1LossType
|
||||
|
||||
@@ -23,10 +23,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* variational auto encoder. This function is the log of hyperbolic
|
||||
* cosine of difference between true values and predicted values.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class LogCoshLossType
|
||||
|
||||
@@ -22,11 +22,9 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* values of 1 or -1. If the label is 1 then the first input should be ranked
|
||||
* higher than the second input at a distance larger than a margin, and vice-
|
||||
* versa if the label is -1.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MarginRankingLossType
|
||||
|
||||
@@ -37,10 +37,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MeanAbsolutePercentageErrorType
|
||||
|
||||
@@ -18,13 +18,11 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* The mean bias error performance function measures the network's
|
||||
* performance according to the mean of errors.
|
||||
* The mean bias error performance function measures the network's performance
|
||||
* according to the mean of errors.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MeanBiasErrorType
|
||||
|
||||
@@ -21,11 +21,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* The mean squared error performance function measures the network's
|
||||
* performance according to the mean of squared errors.
|
||||
*
|
||||
* @tparam ActivationFunction Activation function used for the embedding layer.
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MeanSquaredErrorType
|
||||
|
||||
@@ -18,13 +18,11 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* The mean squared logarithmic error performance function measures the network's
|
||||
* performance according to the mean of squared logarithmic errors.
|
||||
* The mean squared logarithmic error performance function measures the
|
||||
* network's performance according to the mean of squared logarithmic errors.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MeanSquaredLogarithmicErrorType
|
||||
|
||||
@@ -22,10 +22,14 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* The Multi-label Soft Margin Loss function.
|
||||
*
|
||||
* It is a criterion that optimizes a multi-label one-versus-all loss based on
|
||||
* max-entropy, between input x and target y of size (N, C) where N is the
|
||||
* batch size and C is the number of classes.
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class MultiLabelSoftMarginLossType
|
||||
|
||||
@@ -20,13 +20,11 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
/**
|
||||
* Implementation of the negative log likelihood layer. The negative log
|
||||
* likelihood layer expectes that the input contains log-probabilities for each
|
||||
* class. The layer also expects a class index, in the range between 1 and the
|
||||
* class. The layer also expects a class index in the range [0, numClasses - 1]
|
||||
* number of classes, as target when calling the Forward function.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class NegativeLogLikelihoodType
|
||||
|
||||
@@ -20,14 +20,11 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* Implementation of the Poisson negative log likelihood loss. This loss
|
||||
* function expects input for each class. It also expects a class index,
|
||||
* in the range between 1 and the number of classes, as target when calling
|
||||
* the Forward function.
|
||||
* function expects input for each class. It also expects a class index, in the
|
||||
* range [0, numClasses - 1], as target when calling the Forward function.
|
||||
*
|
||||
* @tparam MatType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class PoissonNLLLossType
|
||||
|
||||
@@ -23,10 +23,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* performance equal to the negative log probability of the target with
|
||||
* the input distribution.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
* @tparam DistType The type of distribution parametrized by the input.
|
||||
*/
|
||||
template<
|
||||
|
||||
@@ -40,10 +40,8 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class SigmoidCrossEntropyErrorType
|
||||
|
||||
@@ -22,10 +22,14 @@ namespace mlpack {
|
||||
namespace ann /** Artificial Neural Network. */ {
|
||||
|
||||
/**
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* The Soft Margin Loss function.
|
||||
*
|
||||
* It is a criterion that optimizes a two-class classification logistic loss,
|
||||
* between input x and target y, both having the same shape, with the target
|
||||
* containing only the values 1 or -1.
|
||||
*
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class SoftMarginLossType
|
||||
|
||||
@@ -24,22 +24,21 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
* of the positive (truthy) and negative (falsy) inputs.
|
||||
* The distance between two samples A and B is defined as square of L2 norm
|
||||
* of A-B.
|
||||
*
|
||||
*
|
||||
* For more information, refer the following paper.
|
||||
*
|
||||
* @code
|
||||
* @article{Schroff2015,
|
||||
* author = {Florian Schroff, Dmitry Kalenichenko, James Philbin},
|
||||
* title = {FaceNet: A Unified Embedding for Face Recognition and Clustering},
|
||||
* title = {FaceNet: A Unified Embedding for Face Recognition and
|
||||
* Clustering},
|
||||
* year = {2015},
|
||||
* url = {https://arxiv.org/abs/1503.03832},
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam OutputDataType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class TripletMarginLossType
|
||||
|
||||
@@ -21,13 +21,11 @@ namespace ann /** Artificial Neural Network. */ {
|
||||
/**
|
||||
* Implementation of the variance reduced classification reinforcement layer.
|
||||
* This layer is meant to be used in combination with the reinforce normal layer
|
||||
* (ReinforceNormalLayer), which expects that an reward:
|
||||
* (1 for success, 0 otherwise).
|
||||
* (ReinforceNormalLayer), which expects that the reward is 1 for success, and 0
|
||||
* otherwise.
|
||||
*
|
||||
* @tparam InputDataType Type of the input data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Type of the output data (arma::colvec, arma::mat,
|
||||
* arma::sp_mat or arma::cube).
|
||||
* @tparam MatType Matrix representation to accept as input and use for
|
||||
* computation.
|
||||
*/
|
||||
template<typename MatType = arma::mat>
|
||||
class VRClassRewardType
|
||||
|
||||
Reference in New Issue
Block a user