|
STK++ 0.9.13
|
The Gaussian mixture model Kmm_sk is an isotrope Gaussian mixture model on a kernel space.
More...
#include <STK_Kmm_sk.h>

Public Types | |
| typedef KmmBase< Kmm_sk > | Base |
Public Types inherited from STK::KmmBase< Kmm_sk > | |
| typedef IMixtureDensity< Kmm_sk > | Base |
| typedef hidden::MixtureTraits< Kmm_sk >::Array | Array |
Public Types inherited from STK::IMixtureDensity< Derived > | |
| typedef hidden::MixtureTraits< Derived >::Array | Array |
| typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
| typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
| Kmm_sk (int nbCluster) | |
| default constructor | |
| Kmm_sk (Kmm_sk const &model) | |
| copy constructor | |
| ~Kmm_sk () | |
| destructor | |
| int | computeNbFreeParameters () const |
| Real | lnComponentProbability (int i, int k) const |
| void | randomInit (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
| Initialize randomly the variances of the Gaussian kernel mixture. | |
| bool | run (CArrayXX const *const &p_tik, CPointX const *const &p_tk) |
| update the variances. | |
Public Member Functions inherited from STK::KmmBase< Kmm_sk > | |
| Real | sigma2 (int k) const |
| Real | dim (int k) const |
| Kernel::IKernel const *const | p_kernel () const |
| CArrayXX | dik () const |
| void | setDim (Real const &dim) |
| set the dimensions of the kernel mixture model using an unique value | |
| void | setDim (ExprBase< Vector > const &dim) |
| set the dimension of the kernel mixture model | |
| void | setKernel (Kernel::IKernel const *p_kernel) |
| set the dimensions of the kernel mixture model using an unique value. | |
| Real | impute (int i, int j, Weights const &pk) const |
| Real | rand (int i, int j, int k) const |
| void | getParameters (ArrayParam ¶ms) const |
| This function is used in order to get the current values of the parameters in an array. | |
| void | writeParameters (CArrayXX const *p_tik, ostream &os) const |
| This function can be used to write summary of parameters to the output stream. | |
| int | nbSample () const |
| int | nbCluster () const |
Public Member Functions inherited from STK::IMixtureDensity< Derived > | |
| ~IMixtureDensity () | |
| destructor | |
| int | nbCluster () const |
| int | nbSample () const |
| Real | lnNbSample () const |
| Array const *const & | p_data () const |
| Parameters const & | param () const |
| void | setData (Array const &data) |
| Set the data set. | |
| void | setData (Array const &data, int nbRow, int nbCol, bool byRow=true) |
| Set the data set and give dimensions. | |
| bool | initializeStep () |
| This function will be called at the beginning of the estimation process once the model is created and data is set. | |
| void | setParametersStep () |
| set the parameters obtained with the intermediate results and release the intermediate results. | |
| void | finalizeStep () |
| This function will be called once the model is estimated. | |
| template<class Weights > | |
| Type | sample (int i, int j, Weights const &tk) const |
Public Member Functions inherited from STK::IRecursiveTemplate< Derived > | |
| Derived & | asDerived () |
| static cast : return a reference of this with a cast to the derived class. | |
| Derived const & | asDerived () const |
| static cast : return a const reference of this with a cast to the derived class. | |
| Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
| Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
| Derived * | clone () const |
| create a leaf using the copy constructor of the Derived class. | |
| Derived * | clone (bool isRef) const |
| create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Additional Inherited Members | |
Public Attributes inherited from STK::KmmBase< Kmm_sk > | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
Protected Member Functions inherited from STK::KmmBase< Kmm_sk > | |
| KmmBase (int nbCluster) | |
| default constructor | |
| KmmBase (KmmBase const &model) | |
| copy constructor | |
| ~KmmBase () | |
| destructor | |
| void | initializeModel () |
| Initialize the model before its first use. | |
| void | compute_dik (CArrayXX const *p_tik, CPointX const *p_tk) |
| compute the distance of the ith individual to the kth centroid | |
| void | initializeModelImpl () |
| default implementation of initializeModelImpl (do nothing) | |
Protected Member Functions inherited from STK::IMixtureDensity< Derived > | |
| IMixtureDensity (int nbCluster) | |
| Default constructor. | |
| IMixtureDensity (IMixtureDensity const &model) | |
| copy constructor. | |
| void | initializeModel () |
| Initialize the model before its first use. | |
| bool | initializeStepImpl () |
| default implementation of initializeStepImpl (do nothing and return true) | |
| void | finalizeStepImpl () |
| default implementation of finalizeStepImpl (do nothing) | |
| void | setNbSample (int nbSample) |
| Set the number of sample of the model (needed by kernel models) | |
Protected Member Functions inherited from STK::IRecursiveTemplate< Derived > | |
| IRecursiveTemplate () | |
| constructor. | |
| ~IRecursiveTemplate () | |
| destructor. | |
Protected Attributes inherited from STK::KmmBase< Kmm_sk > | |
| Kernel::IKernel const * | p_kernel_ |
| pointer on the kernel | |
| CArrayXX | dik_ |
| Array of the intermediate results dik. | |
Protected Attributes inherited from STK::IMixtureDensity< Derived > | |
| Parameters | param_ |
| parameters of the derived mixture model. | |
The Gaussian mixture model Kmm_sk is an isotrope Gaussian mixture model on a kernel space.
It has a density function of the form
![\[
f(\mathbf{x}|\theta) = \sum_{k=1}^K p_k
\sum_{k=1}^K p_k \left(\frac{1}{\sqrt{2\pi}\sigma_k}\right)^{d_k}
\exp\left\{ -\frac{\|\phi(x)-m_k\|^2}{2\sigma_k^2} \right\}
\]](form_168.png)
where 
In a Kmm_sk model, the data set refer to the Gram's matrix.
Definition at line 75 of file STK_Kmm_sk.h.
Definition at line 78 of file STK_Kmm_sk.h.
| STK::Kmm_sk::Kmm_sk | ( | int | nbCluster | ) |
default constructor
| nbCluster | number of cluster in the model |
Definition at line 50 of file STK_Kmm_sk.cpp.
copy constructor
| model | The model to copy |
Definition at line 54 of file STK_Kmm_sk.cpp.
| STK::Kmm_sk::~Kmm_sk | ( | ) |
| int STK::Kmm_sk::computeNbFreeParameters | ( | ) | const |
Definition at line 58 of file STK_Kmm_sk.cpp.
References STK::KmmBase< Kmm_sk >::nbCluster(), and STK::KmmBase< Kmm_sk >::param_.
| i,k | indexes of the sample and of the component |
Definition at line 64 of file STK_Kmm_sk.cpp.
References STK::KmmBase< Kmm_sk >::dik_, and STK::KmmBase< Kmm_sk >::param_.
Initialize randomly the variances of the Gaussian kernel mixture.
Definition at line 71 of file STK_Kmm_sk.cpp.
References _T, STK::KmmBase< Kmm_sk >::compute_dik(), STK::KmmBase< Kmm_sk >::dik_, STK::KmmBase< Kmm_sk >::param_, STK::ExprBase< Derived >::prod(), STK::KmmBase< Kmm_sk >::rand(), stk_cout, and STK::sum().
update the variances.
Definition at line 86 of file STK_Kmm_sk.cpp.
References _T, STK::KmmBase< Kmm_sk >::compute_dik(), STK::KmmBase< Kmm_sk >::dik_, STK::KmmBase< Kmm_sk >::param_, STK::ExprBase< Derived >::prod(), stk_cout, and STK::Stat::sumByCol().