DMRITool
v0.1.1-139-g860d86b4
Diffusion MRI Tool
|
#include <dicts.h>
Public Member Functions | |
void | getA (Matrix< T > &A) const |
void | getB (Matrix< T > &B) const |
void | getD (Matrix< T > &D) const |
int | getIter () const |
void | train (const Data< T > &X, const ParamDictLearn< T > ¶m) |
void | train (const Data< T > &X, const vector_groups &groups, const int J, const constraint_type mode, const bool whiten=false, const T *param_C=NULL, const int p=1, const bool pattern=false) |
Trainer () | |
Trainer (const int k, const int batchsize=256, const int NUM_THREADS=-1) | |
Trainer (const Matrix< T > &D, const int batchsize=256, const int NUM_THREADS=-1) | |
Trainer (const Matrix< T > &A, const Matrix< T > &B, const Matrix< T > &D, const int itercount, const int batchsize, const int NUM_THREADS) | |
void | trainOffline (const Data< T > &X, const ParamDictLearn< T > ¶m) |
Private Member Functions | |
void | cleanDict (const Data< T > &X, Matrix< T > &G, const bool posD=false, const constraint_type_D modeD=L2, const T gamma1=0, const T gamma2=0, const T maxCorrel=0.999999) |
void | cleanDict (Matrix< T > &G) |
Trainer< T > & | operator= (const Trainer< T > &trainer) |
Trainer (const Trainer< T > &trainer) | |
Private Attributes | |
Matrix< T > | _A |
Matrix< T > | _B |
int | _batchsize |
Matrix< T > | _D |
bool | _initialDict |
int | _itercount |
int | _k |
int | _NUM_THREADS |
spams::Trainer< T >::Trainer | ( | ) |
Empty constructor.
Definition at line 187 of file dicts.h.
References spams::Trainer< T >::_batchsize, spams::Trainer< T >::_NUM_THREADS, MAX_THREADS, and MIN.
spams::Trainer< T >::Trainer | ( | const int | k, |
const int | batchsize = 256 , |
||
const int | NUM_THREADS = -1 |
||
) |
Constructor with data.
Definition at line 197 of file dicts.h.
References spams::Trainer< T >::_NUM_THREADS, MAX_THREADS, and MIN.
spams::Trainer< T >::Trainer | ( | const Matrix< T > & | D, |
const int | batchsize = 256 , |
||
const int | NUM_THREADS = -1 |
||
) |
Constructor with initial dictionary.
Definition at line 210 of file dicts.h.
References spams::Trainer< T >::_A, spams::Trainer< T >::_B, spams::Trainer< T >::_D, spams::Trainer< T >::_NUM_THREADS, spams::Matrix< T >::m(), MAX_THREADS, MIN, and spams::Matrix< T >::n().
spams::Trainer< T >::Trainer | ( | const Matrix< T > & | A, |
const Matrix< T > & | B, | ||
const Matrix< T > & | D, | ||
const int | itercount, | ||
const int | batchsize, | ||
const int | NUM_THREADS | ||
) |
Constructor with existing structure.
Definition at line 226 of file dicts.h.
References spams::Trainer< T >::_A, spams::Trainer< T >::_B, spams::Trainer< T >::_D, spams::Trainer< T >::_NUM_THREADS, MAX_THREADS, and MIN.
|
explicitprivate |
Forbid lazy copies.
|
private |
clean the dictionary
remove element j and replace it by a random element of X
Definition at line 243 of file dicts.h.
References spams::Trainer< T >::_D, spams::abs(), spams::Vector< T >::copy(), spams::Data< T >::getData(), spams::L1L2, spams::L2, spams::Data< T >::n(), spams::Vector< T >::normalize(), spams::Matrix< T >::rawX(), spams::Matrix< T >::refCol(), spams::Vector< T >::sparseProject(), and spams::Vector< T >::thrsPos().
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
private |
clean the dictionary
Definition at line 284 of file dicts.h.
References spams::Trainer< T >::_D, and spams::Matrix< T >::rawX().
|
inline |
Accessors.
Definition at line 154 of file dicts.h.
References spams::Matrix< T >::copy().
|
inline |
Definition at line 155 of file dicts.h.
References spams::Matrix< T >::copy().
|
inline |
Definition at line 156 of file dicts.h.
References spams::Matrix< T >::copy().
|
inline |
Definition at line 157 of file dicts.h.
References spams::ParamDictLearn< T >::gamma1, spams::ParamDictLearn< T >::gamma2, spams::L2, spams::ParamDictLearn< T >::modeD, and spams::ParamDictLearn< T >::posD.
|
private |
Forbid lazy copies.
void spams::Trainer< T >::train | ( | const Data< T > & | X, |
const ParamDictLearn< T > & | param | ||
) |
train or retrain using the matrix X
Dictionary Update Check the epoch parity
Definition at line 295 of file dicts.h.
References spams::Trainer< T >::_A, spams::Trainer< T >::_B, spams::Trainer< T >::_batchsize, spams::Trainer< T >::_D, spams::Trainer< T >::_initialDict, spams::Trainer< T >::_itercount, spams::Trainer< T >::_k, spams::Trainer< T >::_NUM_THREADS, spams::Matrix< T >::add(), spams::Vector< T >::add(), spams::Matrix< T >::addDiag(), spams::AUTO, spams::ParamDictLearn< T >::batch, spams::ParamDictLearn< T >::clean, spams::Trainer< T >::cleanDict(), spams::Matrix< T >::conjugateGradient(), spams::Matrix< T >::copy(), spams::Vector< T >::copy(), spams::coreLARS2(), spams::coreORMPB(), spams::ParamDictLearn< T >::gamma1, spams::ParamDictLearn< T >::gamma2, spams::Data< T >::getData(), spams::Timer::getElapsed(), spams::init_omp(), spams::ParamDictLearn< T >::iter, spams::ParamDictLearn< T >::iter_updateD, spams::L1L2, spams::L2, spams::L2ERROR2, spams::ParamDictLearn< T >::lambda, spams::ParamDictLearn< T >::lambda2, spams::ParamDictLearn< T >::log, spams::ParamDictLearn< T >::logName, spams::Data< T >::m(), MAX, MIN, spams::ParamDictLearn< T >::mode, spams::ParamDictLearn< T >::modeD, spams::ParamDictLearn< T >::modeParam, spams::Data< T >::n(), spams::Vector< T >::normalize2(), spams::PARAM1, spams::PARAM2, spams::ParamDictLearn< T >::pattern, spams::PENALTY, spams::ParamDictLearn< T >::posAlpha, spams::ParamDictLearn< T >::posD, spams::Timer::printElapsed(), spams::Vector< T >::randperm(), spams::Matrix< T >::rank1Update(), spams::Vector< T >::rawX(), spams::SpVector< T >::refIndices(), spams::SpVector< T >::refVal(), spams::Matrix< T >::resize(), spams::Vector< T >::resize(), spams::SpVector< T >::resize(), spams::ParamDictLearn< T >::rho, spams::Matrix< T >::scal(), spams::Vector< T >::scal(), spams::Vector< T >::set(), spams::SpVector< T >::setL(), spams::Matrix< T >::setZeros(), spams::Vector< T >::setZeros(), spams::sort(), spams::Vector< T >::sparseProject(), spams::SPARSITY, spams::Timer::start(), spams::ParamDictLearn< T >::stochastic, spams::Timer::stop(), spams::ParamDictLearn< T >::t0, spams::Vector< T >::thrsPos(), spams::Data< T >::V(), spams::ParamDictLearn< T >::verbose, spams::ParamDictLearn< T >::whiten, and spams::writeLog().
void spams::Trainer< T >::train | ( | const Data< T > & | X, |
const vector_groups & | groups, | ||
const int | J, | ||
const constraint_type | mode, | ||
const bool | whiten = false , |
||
const T * | param_C = NULL , |
||
const int | p = 1 , |
||
const bool | pattern = false |
||
) |
train or retrain using the groups XT
void spams::Trainer< T >::trainOffline | ( | const Data< T > & | X, |
const ParamDictLearn< T > & | param | ||
) |
Definition at line 736 of file dicts.h.
References spams::Trainer< T >::_batchsize, spams::Trainer< T >::_D, spams::Trainer< T >::_initialDict, spams::Trainer< T >::_k, spams::Trainer< T >::_NUM_THREADS, spams::Matrix< T >::add(), spams::Vector< T >::add(), spams::ParamDictLearn< T >::clean, spams::Trainer< T >::cleanDict(), spams::Vector< T >::copy(), spams::coreIST(), spams::coreISTconstrained(), spams::ParamDictLearn< T >::gamma1, spams::ParamDictLearn< T >::gamma2, spams::Data< T >::getData(), spams::Timer::getElapsed(), spams::init_omp(), spams::ParamDictLearn< T >::iter, spams::ParamDictLearn< T >::iter_updateD, spams::L1L2, spams::L2, spams::ParamDictLearn< T >::lambda, spams::Data< T >::m(), MAX, MIN, spams::ParamDictLearn< T >::mode, spams::ParamDictLearn< T >::modeD, spams::ParamDictLearn< T >::modeParam, spams::Matrix< T >::mult(), spams::Data< T >::n(), spams::Vector< T >::n(), spams::Matrix< T >::norm_l1_rows(), spams::Vector< T >::normalize2(), spams::PARAM1, spams::PARAM2, spams::ParamDictLearn< T >::pattern, spams::PENALTY, spams::ParamDictLearn< T >::posD, spams::Timer::printElapsed(), spams::Vector< T >::randperm(), spams::Matrix< T >::rank1Update(), spams::Matrix< T >::refCol(), spams::Matrix< T >::resize(), spams::Vector< T >::resize(), spams::SpVector< T >::resize(), spams::ParamDictLearn< T >::rho, spams::Matrix< T >::scal(), spams::Vector< T >::scal(), spams::Matrix< T >::setZeros(), spams::Vector< T >::setZeros(), spams::Vector< T >::sparseProject(), spams::Timer::start(), spams::Vector< T >::sub(), spams::Vector< T >::thrsPos(), spams::Vector< T >::toSparse(), spams::Data< T >::V(), spams::ParamDictLearn< T >::verbose, and spams::ParamDictLearn< T >::whiten.
|
private |
Definition at line 176 of file dicts.h.
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::Trainer().
|
private |
Definition at line 177 of file dicts.h.
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::Trainer().
|
private |
Definition at line 182 of file dicts.h.
Referenced by spams::Trainer< T >::train(), spams::Trainer< T >::Trainer(), and spams::Trainer< T >::trainOffline().
|
private |
Definition at line 178 of file dicts.h.
Referenced by spams::Trainer< T >::cleanDict(), spams::Trainer< T >::train(), spams::Trainer< T >::Trainer(), and spams::Trainer< T >::trainOffline().
|
private |
Definition at line 180 of file dicts.h.
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
private |
Definition at line 181 of file dicts.h.
Referenced by spams::Trainer< T >::train().
|
private |
Definition at line 179 of file dicts.h.
Referenced by spams::Trainer< T >::train(), and spams::Trainer< T >::trainOffline().
|
private |
Definition at line 183 of file dicts.h.
Referenced by spams::Trainer< T >::train(), spams::Trainer< T >::Trainer(), and spams::Trainer< T >::trainOffline().