12 #ifndef MLPACK_METHODS_NCA_NCA_HPP 13 #define MLPACK_METHODS_NCA_NCA_HPP 17 #include <ensmallen.hpp> 48 typename OptimizerType = ens::StandardSGD>
61 NCA(
const arma::mat& dataset,
62 const arma::Row<size_t>& labels,
63 MetricType metric = MetricType());
77 template<
typename... CallbackTypes>
78 void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks);
81 const arma::mat&
Dataset()
const {
return dataset; }
83 const arma::Row<size_t>&
Labels()
const {
return labels; }
86 const OptimizerType&
Optimizer()
const {
return optimizer; }
91 const arma::mat& dataset;
93 const arma::Row<size_t>& labels;
102 OptimizerType optimizer;
109 #include "nca_impl.hpp" The "softmax" stochastic neighbor assignment probability function.
NCA(const arma::mat &dataset, const arma::Row< size_t > &labels, MetricType metric=MetricType())
Construct the Neighborhood Components Analysis object.
Linear algebra utility functions, generally performed on matrices or vectors.
const arma::mat & Dataset() const
Get the dataset reference.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const arma::Row< size_t > & Labels() const
Get the labels reference.
OptimizerType & Optimizer()
void LearnDistance(arma::mat &outputMatrix, CallbackTypes &&... callbacks)
Perform Neighborhood Components Analysis.
const OptimizerType & Optimizer() const
Get the optimizer.
LMetric< 2, false > SquaredEuclideanDistance
The squared Euclidean (L2) distance.
An implementation of Neighborhood Components Analysis, both a linear dimensionality reduction techniq...