SHOGUN v0.9.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 ).
在文件Distribution.h第41行定义。
公有成员 | |
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 void | get_log_likelihood (float64_t **dst, int32_t *num) |
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 () |
保护属性 | |
CFeatures * | features |
float64_t | pseudo_count |
CDistribution | ( | ) |
default constructor
在文件Distribution.cpp第16行定义。
~CDistribution | ( | ) | [virtual] |
在文件Distribution.cpp第22行定义。
virtual float64_t get_derivative | ( | int32_t | num_param, |
int32_t | num_example | ||
) | [virtual] |
get partial derivative of likelihood function
num_param | partial derivative against which param |
num_example | which example |
在文件Distribution.h第130行定义。
virtual CFeatures* get_features | ( | ) | [virtual] |
virtual float64_t get_likelihood_example | ( | int32_t | num_example | ) | [virtual] |
compute likelihood for example
num_example | which example |
在文件Distribution.h第141行定义。
virtual float64_t get_log_derivative | ( | int32_t | num_param, |
int32_t | num_example | ||
) | [pure virtual] |
get partial derivative of likelihood function (logarithmic)
abstract base method
num_param | derivative against which param |
num_example | which example |
在CGHMM、CHistogram、CHMM及CLinearHMM内被实现。
void get_log_likelihood | ( | float64_t ** | dst, |
int32_t * | num | ||
) | [virtual] |
compute log likelihood for each example
dst | where likelihood will be stored |
num | where number of likelihoods will be stored |
在文件Distribution.cpp第37行定义。
virtual float64_t get_log_likelihood_example | ( | int32_t | num_example | ) | [pure virtual] |
compute log likelihood for example
abstract base method
num_example | which example |
在CGHMM、CHistogram、CHMM及CLinearHMM内被实现。
float64_t get_log_likelihood_sample | ( | ) | [virtual] |
compute log likelihood for whole sample
在文件Distribution.cpp第26行定义。
virtual float64_t get_log_model_parameter | ( | int32_t | num_param | ) | [pure virtual] |
get model parameter (logarithmic)
abstrac base method
在CGHMM、CHistogram、CHMM及CLinearHMM内被实现。
virtual float64_t get_model_parameter | ( | int32_t | num_param | ) | [virtual] |
virtual int32_t get_num_model_parameters | ( | ) | [pure virtual] |
get number of parameters in model
abstract base method
在CGHMM、CHistogram、CHMM及CLinearHMM内被实现。
int32_t get_num_relevant_model_parameters | ( | ) | [virtual] |
get number of parameters in model that are relevant, i.e. > ALMOST_NEG_INFTY
在文件Distribution.cpp第50行定义。
virtual float64_t get_pseudo_count | ( | ) | [virtual] |
virtual void set_features | ( | CFeatures * | f | ) | [virtual] |
virtual void set_pseudo_count | ( | float64_t | pseudo | ) | [virtual] |
virtual bool train | ( | CFeatures * | data = NULL | ) | [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) |
在CGHMM、CHistogram、CHMM及CLinearHMM内被实现。
feature vectors
在文件Distribution.h第181行定义。
float64_t pseudo_count [protected] |
pseudo count
在文件Distribution.h第183行定义。