infomax_ica.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00047 #ifndef U_INFOMAX_ICA
00048 #define U_INFOMAX_ICA
00049
00050
00051
00052
00053 #include <cmath>
00054 #include <climits>
00055 #include "fastlib/fastlib.h"
00056
00057 class TestInfomaxICA;
00058
00059 const fx_entry_doc infomax_ica_entries[] = {
00060 {"lambda", FX_PARAM, FX_DOUBLE, NULL,
00061 " Learning rate for infomax method.\n"},
00062 {"B", FX_PARAM, FX_INT, NULL,
00063 " Infomax data window size.\n"},
00064 {"epsilon", FX_PARAM, FX_DOUBLE, NULL,
00065 " Infomax algorithm stop threshold.\n"},
00066 FX_ENTRY_DOC_DONE
00067 };
00068
00069 const fx_module_doc infomax_ica_doc = {
00070 infomax_ica_entries, NULL,
00071 "Performs ICA decomposition using Infomax method.\n"
00072 };
00073
00087 class InfomaxICA {
00088
00089 friend class TestInfomaxICA;
00090
00091 public:
00092 InfomaxICA();
00093 InfomaxICA(double lambda, int B, double epsilon);
00094 void applyICA(const Matrix &dataset);
00095 void evaluateICA();
00096 void displayMatrix(const Matrix &m);
00097 void displayVector(const Vector &m);
00098 void getUnmixing(Matrix &w);
00099 void getSources(const Matrix &dataset, Matrix &s);
00100 void setLambda(const double lambda);
00101 void setB(const int b);
00102 void setEpsilon(const double epsilon);
00103
00104 private:
00105 Matrix w_;
00106 Matrix data_;
00107
00108 double lambda_;
00109
00110 int b_;
00111
00112 double epsilon_;
00113
00114 void expM(Matrix &m);
00115 void addOne(Matrix &m);
00116 void invertVals(Matrix &m);
00117 void vectorize(const Matrix &m, Vector &v);
00118 Matrix eye(index_t dim,double diagVal);
00119 Matrix sqrtm(const Matrix &m);
00120 void sphere(Matrix &m);
00121 Matrix subMeans(const Matrix &m);
00122 Vector rowMean(const Matrix &m);
00123 Matrix sampleCovariance(const Matrix &m);
00124 double w_delta(const Matrix &w_prev, const Matrix &w_pres);
00125 };
00126
00127 #endif