class Kmeans

This class can be used to do a "kmeans" on a given set of data.

Inheritance:


Public Fields

[more]int* min_cluster
for each example, keep the index of the neirest cluster
[more]SeqDataSet* data
we need the dataset in order to initialize correctly the centers of the clusters

Public Methods

[more] Kmeans(int n_observations_, int n_gaussians_, real* stdev_threshold_, real prior_weights_, SeqDataSet* data_)
[more]virtual real frameLogProbability(real* observations, real* inputs, int t)
note that this method returns in fact the euclidean distance between the observation and the neirest cluster


Inherited from DiagonalGMM:

Public Fields

oint n_gaussians
oreal prior_weights
oEMTrainer* initial_kmeans_trainer
oList* initial_kmeans_trainer_measurers
oList* initial_params
ochar* initial_file
oreal* log_weights
oreal* dlog_weights
oreal* var_threshold
oreal** log_probabilities_g
oreal* sum_log_var_plus_n_obs_log_2_pi
oreal** minus_half_over_var
oreal** means_acc

Public Methods

ovirtual real frameLogProbabilityOneGaussian(real* observations, real* inputs, int g)


Inherited from Distribution:

Public Fields

oint n_observations
oint tot_n_frames
oint max_n_frames
oreal log_probability
oreal* log_probabilities

Public Methods

ovirtual real logProbability(List* inputs)
ovirtual real viterbiLogProbability(List* inputs)
ovirtual void frameExpectation(real* observations, real* inputs, int t)
ovirtual void eMIterInitialize()
ovirtual void iterInitialize()
ovirtual void eMSequenceInitialize(List* inputs)
ovirtual void sequenceInitialize(List* inputs)
ovirtual void eMAccPosteriors(List* inputs, real log_posterior)
ovirtual void frameEMAccPosteriors(real* observations, real log_posterior, real* inputs, int t)
ovirtual void viterbiAccPosteriors(List* inputs, real log_posterior)
ovirtual void frameViterbiAccPosteriors(real* observations, real log_posterior, real* inputs, int t)
ovirtual void eMUpdate()
ovirtual void decode(List* inputs)
ovirtual void eMForward(List* inputs)
ovirtual void viterbiForward(List* inputs)
ovirtual void frameBackward(real* observations, real* alpha, real* inputs, int t)
ovirtual void viterbiBackward(List* inputs, real* alpha)


Inherited from GradientMachine:

Public Fields

obool is_free
oList* params
oList* der_params
oint n_params
oreal* beta

Public Methods

ovirtual void init()
ovirtual int numberOfParams()
ovirtual void backward(List* inputs, real* alpha)
ovirtual void allocateMemory()
ovirtual void freeMemory()
ovirtual void loadFILE(FILE* file)
ovirtual void saveFILE(FILE* file)


Inherited from Machine:

Public Fields

oint n_inputs
oint n_outputs
oList* outputs

Public Methods

ovirtual void forward(List* inputs)
ovirtual void reset()


Inherited from Object:

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="", bool is_allowed_after_init=false)
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="", bool is_allowed_after_init=false)
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="", bool is_allowed_after_init=false)
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid load(const char* filename)
ovoid save(const char* filename)


Documentation

This class can be used to do a "kmeans" on a given set of data. It has been implemented in the framework of a Distribution that can be trained with EM. This means that the kmeans distance is in fact returned by the method logProbability.

Note that as Kmeans is a subclass of DiagonalGMM, they share the same parameter structure. Hence, a DiagonalGMM can be easily initialized by a Kmeans.

oint* min_cluster
for each example, keep the index of the neirest cluster

oSeqDataSet* data
we need the dataset in order to initialize correctly the centers of the clusters

o Kmeans(int n_observations_, int n_gaussians_, real* stdev_threshold_, real prior_weights_, SeqDataSet* data_)

ovirtual real frameLogProbability(real* observations, real* inputs, int t)
note that this method returns in fact the euclidean distance between the observation and the neirest cluster


This class has no child classes.
Author:
Samy Bengio (bengio@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.