SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
CDiceKernelNormalizer Class Reference

Detailed Description

DiceKernelNormalizer performs kernel normalization inspired by the Dice coefficient (see http://en.wikipedia.org/wiki/Dice's_coefficient)

\[ k'({\bf x},{\bf x'}) = \frac{2k({\bf x},{\bf x'})}{k({\bf x},{\bf x})+k({\bf x'},{\bf x'}} \]

Definition at line 26 of file DiceKernelNormalizer.h.

Inheritance diagram for CDiceKernelNormalizer:
Inheritance graph
[legend]

Public Member Functions

 CDiceKernelNormalizer (bool use_opt_diag=false)
virtual ~CDiceKernelNormalizer ()
virtual bool init (CKernel *k)
virtual float64_t normalize (float64_t value, int32_t idx_lhs, int32_t idx_rhs)
virtual float64_t normalize_lhs (float64_t value, int32_t idx_lhs)
virtual float64_t normalize_rhs (float64_t value, int32_t idx_rhs)
virtual const char * get_name () const
bool alloc_and_compute_diag (CKernel *k, float64_t *&v, int32_t num)
- Public Member Functions inherited from CKernelNormalizer
 CKernelNormalizer ()
virtual ~CKernelNormalizer ()
virtual void register_params ()
ENormalizerType get_normalizer_type ()
void set_normalizer_type (ENormalizerType type)
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
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)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_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

float64_tdiag_lhs
int32_t num_diag_lhs
float64_tdiag_rhs
int32_t num_diag_rhs
bool use_optimized_diagonal_computation
- Protected Attributes inherited from CKernelNormalizer
ENormalizerType m_type

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- Protected Member Functions inherited from CSGObject
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)

Constructor & Destructor Documentation

CDiceKernelNormalizer ( bool  use_opt_diag = false)

default constructor

Parameters
use_opt_diag- some kernels support faster diagonal compuation via compute_diag(idx), this flag enables this

Definition at line 33 of file DiceKernelNormalizer.h.

virtual ~CDiceKernelNormalizer ( )
virtual

default destructor

Definition at line 47 of file DiceKernelNormalizer.h.

Member Function Documentation

bool alloc_and_compute_diag ( CKernel k,
float64_t *&  v,
int32_t  num 
)

alloc and compute the vector containing the square root of the diagonal elements of this kernel.

Definition at line 125 of file DiceKernelNormalizer.h.

virtual const char* get_name ( ) const
virtual

Returns the name of the SGSerializable instance. It MUST BE the CLASS NAME without the prefixed `C'.

Returns
name of the SGSerializable

Implements CSGObject.

Definition at line 117 of file DiceKernelNormalizer.h.

virtual bool init ( CKernel k)
virtual

initialization of the normalizer

Parameters
kkernel

Implements CKernelNormalizer.

Definition at line 55 of file DiceKernelNormalizer.h.

virtual float64_t normalize ( float64_t  value,
int32_t  idx_lhs,
int32_t  idx_rhs 
)
virtual

normalize the kernel value

Parameters
valuekernel value
idx_lhsindex of left hand side vector
idx_rhsindex of right hand side vector

Implements CKernelNormalizer.

Definition at line 85 of file DiceKernelNormalizer.h.

virtual float64_t normalize_lhs ( float64_t  value,
int32_t  idx_lhs 
)
virtual

normalize only the left hand side vector

Parameters
valuevalue of a component of the left hand side feature vector
idx_lhsindex of left hand side vector

Implements CKernelNormalizer.

Definition at line 96 of file DiceKernelNormalizer.h.

virtual float64_t normalize_rhs ( float64_t  value,
int32_t  idx_rhs 
)
virtual

normalize only the right hand side vector

Parameters
valuevalue of a component of the right hand side feature vector
idx_rhsindex of right hand side vector

Implements CKernelNormalizer.

Definition at line 106 of file DiceKernelNormalizer.h.

Member Data Documentation

float64_t* diag_lhs
protected

diagonal left-hand side

Definition at line 151 of file DiceKernelNormalizer.h.

float64_t* diag_rhs
protected

diagonal right-hand side

Definition at line 156 of file DiceKernelNormalizer.h.

int32_t num_diag_lhs
protected

num diag lhs

Definition at line 153 of file DiceKernelNormalizer.h.

int32_t num_diag_rhs
protected

num diag rhs

Definition at line 158 of file DiceKernelNormalizer.h.

bool use_optimized_diagonal_computation
protected

flat if optimized diagonal computation is used

Definition at line 161 of file DiceKernelNormalizer.h.


The documentation for this class was generated from the following file:

SHOGUN Machine Learning Toolbox - Documentation