|
Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Machine learning algorithms. More...
Classes | |
| class | adaline |
Functions | |
| int | save_u_matrix (const char *fname, const std::vector< std::vector< std::valarray< double >>> &W) |
| double | update_weights (const std::valarray< double > &X, std::vector< std::vector< std::valarray< double >>> *W, std::vector< std::valarray< double >> *D, double alpha, int R) |
| void | kohonen_som (const std::vector< std::valarray< double >> &X, std::vector< std::vector< std::valarray< double >>> *W, double alpha_min) |
| void | update_weights (const std::valarray< double > &x, std::vector< std::valarray< double >> *W, std::valarray< double > *D, double alpha, int R) |
| void | kohonen_som_tracer (const std::vector< std::valarray< double >> &X, std::vector< std::valarray< double >> *W, double alpha_min) |
Machine learning algorithms.
| void machine_learning::kohonen_som | ( | const std::vector< std::valarray< double >> & | X, |
| std::vector< std::vector< std::valarray< double >>> * | W, | ||
| double | alpha_min | ||
| ) |
Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset.
| [in] | X | data set |
| [in,out] | W | weights matrix |
| [in] | alpha_min | terminal value of alpha |
| void machine_learning::kohonen_som_tracer | ( | const std::vector< std::valarray< double >> & | X, |
| std::vector< std::valarray< double >> * | W, | ||
| double | alpha_min | ||
| ) |
Apply incremental algorithm with updating neighborhood and learning rates on all samples in the given datset.
| [in] | X | data set |
| [in,out] | W | weights matrix |
| [in] | alpha_min | terminal value of alpha |
| int machine_learning::save_u_matrix | ( | const char * | fname, |
| const std::vector< std::vector< std::valarray< double >>> & | W | ||
| ) |
Create the distance matrix or U-matrix from the trained 3D weiths matrix and save to disk.
| [in] | fname | filename to save in (gets overwriten without confirmation) |
| [in] | W | model matrix to save |
| void machine_learning::update_weights | ( | const std::valarray< double > & | x, |
| std::vector< std::valarray< double >> * | W, | ||
| std::valarray< double > * | D, | ||
| double | alpha, | ||
| int | R | ||
| ) |
Update weights of the SOM using Kohonen algorithm
| [in] | X | data point |
| [in,out] | W | weights matrix |
| [in,out] | D | temporary vector to store distances |
| [in] | alpha | learning rate \(0<\alpha\le1\) |
| [in] | R | neighborhood range |
| double machine_learning::update_weights | ( | const std::valarray< double > & | X, |
| std::vector< std::vector< std::valarray< double >>> * | W, | ||
| std::vector< std::valarray< double >> * | D, | ||
| double | alpha, | ||
| int | R | ||
| ) |
Update weights of the SOM using Kohonen algorithm
| [in] | X | data point - N features |
| [in,out] | W | weights matrix - PxQxN |
| [in,out] | D | temporary vector to store distances PxQ |
| [in] | alpha | learning rate \(0<\alpha\le1\) |
| [in] | R | neighborhood range |