12 #ifndef MLPACK_METHODS_NCA_NCA_HPP 13 #define MLPACK_METHODS_NCA_NCA_HPP 65 NCA(
const arma::mat& dataset,
66 const arma::Row<size_t>& labels,
67 MetricType metric = MetricType());
81 const arma::mat&
Dataset()
const {
return dataset; }
83 const arma::Row<size_t>&
Labels()
const {
return labels; }
86 const OptimizerType<SoftmaxErrorFunction<MetricType> >&
Optimizer()
const 88 OptimizerType<SoftmaxErrorFunction<MetricType> >&
Optimizer()
93 const arma::mat& dataset;
95 const arma::Row<size_t>& labels;
104 OptimizerType<SoftmaxErrorFunction<MetricType> > optimizer;
111 #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< SoftmaxErrorFunction< MetricType > > & Optimizer()
const OptimizerType< SoftmaxErrorFunction< MetricType > > & Optimizer() const
Get the optimizer.
Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...
LMetric< 2, false > SquaredEuclideanDistance
The squared Euclidean (L2) distance.
An implementation of Neighborhood Components Analysis, both a linear dimensionality reduction techniq...
void LearnDistance(arma::mat &outputMatrix)
Perform Neighborhood Components Analysis.