12 #ifndef MLPACK_METHODS_NCA_NCA_IMPL_HPP 13 #define MLPACK_METHODS_NCA_NCA_IMPL_HPP 22 template<
typename MetricType,
typename OptimizerType>
24 const arma::Row<size_t>& labels,
29 errorFunction(dataset, labels, metric)
32 template<
typename MetricType,
typename OptimizerType>
33 template<
typename... CallbackTypes>
35 CallbackTypes&&... callbacks)
38 if ((outputMatrix.n_rows != dataset.n_rows) ||
39 (outputMatrix.n_cols != dataset.n_rows))
40 outputMatrix.eye(dataset.n_rows, dataset.n_rows);
44 optimizer.Optimize(errorFunction, outputMatrix, callbacks...);
static void Start(const std::string &name)
Start the given timer.
Definition: timers.cpp:28
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
void LearnDistance(arma::mat &outputMatrix, CallbackTypes &&... callbacks)
Perform Neighborhood Components Analysis.
Definition: nca_impl.hpp:34
NCA(const arma::mat &dataset, const arma::Row< size_t > &labels, MetricType metric=MetricType())
Construct the Neighborhood Components Analysis object.
Definition: nca_impl.hpp:23
static void Stop(const std::string &name)
Stop the given timer.
Definition: timers.cpp:36