23 #include <Eigen/Dense>
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef std::set<CImpostorNode> ImpostorsSetType;
64 bool operator<(
const CImpostorNode& rhs)
const;
87 static void check_training_setup(CFeatures* features,
const CLabels* labels, SGMatrix<float64_t>& init_transform);
93 static SGMatrix<index_t> find_target_nn(CDenseFeatures<float64_t>* x, CMulticlassLabels* y, int32_t k);
96 static Eigen::MatrixXd sum_outer_products(CDenseFeatures<float64_t>* x,
const SGMatrix<index_t> target_nn);
99 static ImpostorsSetType find_impostors(CDenseFeatures<float64_t>* x, CMulticlassLabels* y,
const Eigen::MatrixXd& L,
const SGMatrix<index_t> target_nn,
const uint32_t iter,
const uint32_t correction);
102 static void update_gradient(CDenseFeatures<float64_t>* x,
Eigen::MatrixXd& G,
const ImpostorsSetType& Nc,
const ImpostorsSetType& Np,
float64_t mu);
108 static void correct_stepsize(
float64_t& stepsize,
const SGVector<float64_t> obj,
const uint32_t iter);
115 static bool check_termination(
float64_t stepsize,
const SGVector<float64_t> obj, uint32_t iter, uint32_t maxiter,
float64_t stepsize_threshold,
float64_t obj_threshold);
120 static SGMatrix<float64_t> compute_pca_transform(CDenseFeatures<float64_t>* features);
132 static SGVector<float64_t> compute_impostors_sqdists(
Eigen::MatrixXd& L,
const ImpostorsSetType& Nexact);
135 static ImpostorsSetType find_impostors_exact(
Eigen::MatrixXd& LX,
const Eigen::MatrixXd& sqdists, CMulticlassLabels* y,
const SGMatrix<index_t> target_nn, int32_t k);
138 static ImpostorsSetType find_impostors_approx(
Eigen::MatrixXd& LX,
const Eigen::MatrixXd& sqdists,
const ImpostorsSetType& Nexact,
const SGMatrix<index_t> target_nn);
141 static std::vector<index_t> get_examples_label(CMulticlassLabels* y,
float64_t yi);
144 static std::vector<index_t> get_examples_gtlabel(CMulticlassLabels* y,
float64_t yi);
151 static CEuclideanDistance* setup_distance(CDenseFeatures<float64_t>* x, std::vector<index_t>& a, std::vector<index_t>& b);
all of classes and functions are contained in the shogun namespace