MLPACK  1.0.8
radical.hpp
Go to the documentation of this file.
1 
24 #ifndef __MLPACK_METHODS_RADICAL_RADICAL_HPP
25 #define __MLPACK_METHODS_RADICAL_RADICAL_HPP
26 
27 #include <mlpack/core.hpp>
28 
29 namespace mlpack {
30 namespace radical {
31 
53 class Radical
54 {
55  public:
69  Radical(const double noiseStdDev = 0.175,
70  const size_t replicates = 30,
71  const size_t angles = 150,
72  const size_t sweeps = 0,
73  const size_t m = 0);
74 
84  void DoRadical(const arma::mat& matX, arma::mat& matY, arma::mat& matW);
85 
92  double Vasicek(arma::vec& x) const;
93 
99  void CopyAndPerturb(arma::mat& xNew, const arma::mat& x) const;
100 
102  double DoRadical2D(const arma::mat& matX);
103 
105  double NoiseStdDev() const { return noiseStdDev; }
107  double& NoiseStdDev() { return noiseStdDev; }
108 
110  size_t Replicates() const { return replicates; }
112  size_t& Replicates() { return replicates; }
113 
115  size_t Angles() const { return angles; }
117  size_t& Angles() { return angles; }
118 
120  size_t Sweeps() const { return sweeps; }
122  size_t& Sweeps() { return sweeps; }
123 
124  private:
127  double noiseStdDev;
128 
130  size_t replicates;
131 
133  size_t angles;
134 
137  size_t sweeps;
138 
140  size_t m;
141 
143  arma::mat perturbed;
145  arma::mat candidate;
146 };
147 
148 void WhitenFeatureMajorMatrix(const arma::mat& matX,
149  arma::mat& matXWhitened,
150  arma::mat& matWhitening);
151 
152 }; // namespace radical
153 }; // namespace mlpack
154 
155 #endif
double Vasicek(arma::vec &x) const
Vasicek's m-spacing estimator of entropy, with overlap modification from (Learned-Miller and Fisher...
size_t & Replicates()
Modify the number of Gaussian-perturbed replicates used per point.
Definition: radical.hpp:112
double & NoiseStdDev()
Modify the standard deviation of the additive Gaussian noise.
Definition: radical.hpp:107
size_t replicates
Number of Gaussian-perturbed replicates to use (per point) in Radical2D.
Definition: radical.hpp:130
arma::mat perturbed
Internal matrix, held as member variable to prevent memory reallocations.
Definition: radical.hpp:143
size_t & Sweeps()
Modify the number of sweeps.
Definition: radical.hpp:122
size_t & Angles()
Modify the number of angles considered during brute-force search.
Definition: radical.hpp:117
double noiseStdDev
Standard deviation of the Gaussian noise added to the replicates of the data points during Radical2D...
Definition: radical.hpp:127
double NoiseStdDev() const
Get the standard deviation of the additive Gaussian noise.
Definition: radical.hpp:105
size_t Angles() const
Get the number of angles considered during brute-force search.
Definition: radical.hpp:115
size_t angles
Number of angles to consider in brute-force search during Radical2D.
Definition: radical.hpp:133
void DoRadical(const arma::mat &matX, arma::mat &matY, arma::mat &matW)
Run RADICAL.
size_t Sweeps() const
Get the number of sweeps.
Definition: radical.hpp:120
size_t m
Value of m to use for Vasicek's m-spacing estimator of entropy.
Definition: radical.hpp:140
void CopyAndPerturb(arma::mat &xNew, const arma::mat &x) const
Make replicates of each data point (the number of replicates is set in either the constructor or with...
double DoRadical2D(const arma::mat &matX)
Two-dimensional version of RADICAL.
An implementation of RADICAL, an algorithm for independent component analysis (ICA).
Definition: radical.hpp:53
arma::mat candidate
Internal matrix, held as member variable to prevent memory reallocations.
Definition: radical.hpp:145
size_t Replicates() const
Get the number of Gaussian-perturbed replicates used per point.
Definition: radical.hpp:110
Radical(const double noiseStdDev=0.175, const size_t replicates=30, const size_t angles=150, const size_t sweeps=0, const size_t m=0)
Set the parameters to RADICAL.
void WhitenFeatureMajorMatrix(const arma::mat &matX, arma::mat &matXWhitened, arma::mat &matWhitening)
size_t sweeps
Number of sweeps; each sweep calls Radical2D once for each pair of dimensions.
Definition: radical.hpp:137