SHOGUN
v1.1.0
|
Base class Distribution from which all methods implementing a distribution are derived.
Distributions are based on some general feature object and have to implement interfaces to
train() - for learning a distribution get_num_model_parameters() - for the total number of model parameters get_log_model_parameter() - for the n-th model parameter (logarithmic) get_log_derivative() - for the partial derivative wrt. to the n-th model parameter get_log_likelihood_example() - for the likelihood for the n-th example
This way methods building on CDistribution, might enumerate over all possible model parameters and obtain the parameter vector and the gradient. This is used to compute e.g. the TOP and Fisher Kernel (cf. CPluginEstimate, CHistogramKernel, CTOPFeatures and CFKFeatures ).
Definition at line 41 of file Distribution.h.
Public Member Functions | |
CDistribution () | |
virtual | ~CDistribution () |
virtual bool | train (CFeatures *data=NULL)=0 |
virtual int32_t | get_num_model_parameters ()=0 |
virtual int32_t | get_num_relevant_model_parameters () |
virtual float64_t | get_log_model_parameter (int32_t num_param)=0 |
virtual float64_t | get_log_derivative (int32_t num_param, int32_t num_example)=0 |
virtual float64_t | get_log_likelihood_example (int32_t num_example)=0 |
virtual float64_t | get_log_likelihood_sample () |
virtual SGVector< float64_t > | get_log_likelihood () |
virtual float64_t | get_model_parameter (int32_t num_param) |
virtual float64_t | get_derivative (int32_t num_param, int32_t num_example) |
virtual float64_t | get_likelihood_example (int32_t num_example) |
virtual void | set_features (CFeatures *f) |
virtual CFeatures * | get_features () |
virtual void | set_pseudo_count (float64_t pseudo) |
virtual float64_t | get_pseudo_count () |
![]() | |
CSGObject () | |
CSGObject (const CSGObject &orig) | |
virtual | ~CSGObject () |
virtual const char * | get_name () const =0 |
virtual bool | is_generic (EPrimitiveType *generic) const |
template<class T > | |
void | set_generic () |
void | unset_generic () |
virtual void | print_serializable (const char *prefix="") |
virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
void | set_global_io (SGIO *io) |
SGIO * | get_global_io () |
void | set_global_parallel (Parallel *parallel) |
Parallel * | get_global_parallel () |
void | set_global_version (Version *version) |
Version * | get_global_version () |
SGVector< char * > | get_modelsel_names () |
char * | get_modsel_param_descr (const char *param_name) |
index_t | get_modsel_param_index (const char *param_name) |
Protected Attributes | |
CFeatures * | features |
float64_t | pseudo_count |
Additional Inherited Members | |
![]() | |
SGIO * | io |
Parallel * | parallel |
Version * | version |
Parameter * | m_parameters |
Parameter * | m_model_selection_parameters |
![]() | |
virtual void | load_serializable_pre () throw (ShogunException) |
virtual void | load_serializable_post () throw (ShogunException) |
virtual void | save_serializable_pre () throw (ShogunException) |
virtual void | save_serializable_post () throw (ShogunException) |
CDistribution | ( | ) |
default constructor
Definition at line 16 of file Distribution.cpp.
|
virtual |
Definition at line 22 of file Distribution.cpp.
|
virtual |
get partial derivative of likelihood function
num_param | partial derivative against which param |
num_example | which example |
Definition at line 129 of file Distribution.h.
|
virtual |
|
virtual |
compute likelihood for example
num_example | which example |
Reimplemented in CGMM.
Definition at line 140 of file Distribution.h.
|
pure virtual |
get partial derivative of likelihood function (logarithmic)
abstract base method
num_param | derivative against which param |
num_example | which example |
Implemented in CHMM, CGMM, CLinearHMM, CGaussian, CHistogram, CGHMM, and CPositionalPWM.
compute log likelihood for each example
Definition at line 37 of file Distribution.cpp.
|
pure virtual |
compute log likelihood for example
abstract base method
num_example | which example |
Implemented in CHMM, CGMM, CLinearHMM, CGaussian, CHistogram, CPositionalPWM, and CGHMM.
|
virtual |
compute log likelihood for whole sample
Definition at line 26 of file Distribution.cpp.
|
pure virtual |
get model parameter (logarithmic)
abstrac base method
Implemented in CHMM, CLinearHMM, CGMM, CGaussian, CHistogram, CGHMM, and CPositionalPWM.
|
virtual |
get model parameter
num_param | which param |
Definition at line 118 of file Distribution.h.
|
pure virtual |
get number of parameters in model
abstract base method
Implemented in CHMM, CLinearHMM, CGMM, CGaussian, CHistogram, CGHMM, and CPositionalPWM.
|
virtual |
get number of parameters in model that are relevant, i.e. > ALMOST_NEG_INFTY
Definition at line 50 of file Distribution.cpp.
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
learn distribution
data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) |
Implemented in CHMM, CGaussian, CLinearHMM, CGMM, CHistogram, CGHMM, and CPositionalPWM.
|
protected |
feature vectors
Definition at line 180 of file Distribution.h.
|
protected |
pseudo count
Definition at line 182 of file Distribution.h.