13 #ifndef MLPACK_METHODS_NCA_NCA_SOFTMAX_ERROR_FUNCTION_HPP 14 #define MLPACK_METHODS_NCA_NCA_SOFTMAX_ERROR_FUNCTION_HPP 44 template<
typename MetricType = metric::SquaredEucl
ideanDistance>
59 const arma::Row<size_t>& labels,
60 MetricType metric = MetricType());
74 double Evaluate(
const arma::mat& covariance);
88 double Evaluate(
const arma::mat& covariance,
90 const size_t batchSize = 1);
100 void Gradient(
const arma::mat& covariance, arma::mat& gradient);
117 template <
typename GradType>
118 void Gradient(
const arma::mat& covariance,
121 const size_t batchSize = 1);
139 arma::Row<size_t> labels;
145 arma::mat lastCoordinates;
147 arma::mat stretchedDataset;
152 arma::vec denominators;
170 void Precalculate(
const arma::mat& coordinates);
The "softmax" stochastic neighbor assignment probability function.
Definition: nca_softmax_error_function.hpp:45
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
const arma::mat GetInitialPoint() const
Get the initial point.
Definition: nca_softmax_error_function_impl.hpp:235
void Gradient(const arma::mat &covariance, arma::mat &gradient)
Evaluate the gradient of the softmax function for the given covariance matrix.
Definition: nca_softmax_error_function_impl.hpp:112
size_t NumFunctions() const
Get the number of functions the objective function can be decomposed into.
Definition: nca_softmax_error_function.hpp:132
SoftmaxErrorFunction(const arma::mat &dataset, const arma::Row< size_t > &labels, MetricType metric=MetricType())
Initialize with the given kernel; useful when the kernel has some state to store, which is set elsewh...
Definition: nca_softmax_error_function_impl.hpp:25
void Shuffle()
Shuffle the dataset.
Definition: nca_softmax_error_function_impl.hpp:37
double Evaluate(const arma::mat &covariance)
Evaluate the softmax function for the given covariance matrix.
Definition: nca_softmax_error_function_impl.hpp:53