libDAI
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
dai::ParameterEstimation Class Referenceabstract

Base class for parameter estimation methods. More...

#include <dai/emalg.h>

Inheritance diagram for dai::ParameterEstimation:
dai::CondProbEstimation

Public Types

typedef ParameterEstimation *(* ParamEstFactory) (const PropertySet &)
 Type of pointer to factory function. More...
 

Public Member Functions

virtual ~ParameterEstimation ()
 Virtual destructor for deleting pointers to derived classes. More...
 
virtual ParameterEstimationclone () const =0
 Virtual copy constructor. More...
 
virtual Prob estimate (const Prob &p)
 Estimate the factor using the provided expectations. More...
 
virtual Prob parametersToFactor (const Prob &params)=0
 Convert a set of estimated parameters to a factor. More...
 
virtual Prob parameters (const Prob &p)=0
 Return parameters for the estimated factor, in a format specific to the parameter estimation. More...
 
virtual size_t probSize () const =0
 Returns the size of the Prob that should be passed to estimate and parameters. More...
 
virtual const std::string & name () const =0
 
virtual const PropertySetproperties () const =0
 

Static Public Member Functions

static ParameterEstimationconstruct (const std::string &method, const PropertySet &p)
 General factory method that constructs the desired ParameterEstimation subclass. More...
 
static void registerMethod (const std::string &method, const ParamEstFactory &f)
 Register a subclass so that it can be used with construct(). More...
 

Static Private Member Functions

static void loadDefaultRegistry ()
 Registers default ParameterEstimation subclasses (currently, only CondProbEstimation). More...
 

Static Private Attributes

static std::map< std::string, ParamEstFactory > * _registry = NULL
 A static registry containing all methods registered so far. More...
 

Detailed Description

Base class for parameter estimation methods.

This class defines the general interface of parameter estimation methods.

Implementations of this interface (see e.g. CondProbEstimation) should register a factory function (virtual constructor) via the static registerMethod() function. This factory function should return a pointer to a newly constructed object, whose type is a subclass of ParameterEstimation, and gets as input a PropertySet of parameters. After a subclass has been registered, instances of it can be constructed using the construct() method.

Implementations are responsible for collecting data from a probability vector passed to it from a SharedParameters container object.

The default registry only contains CondProbEstimation, named "CondProbEstimation".

Author
Charles Vaske

Member Typedef Documentation

typedef ParameterEstimation*(* dai::ParameterEstimation::ParamEstFactory) (const PropertySet &)

Type of pointer to factory function.

Constructor & Destructor Documentation

virtual dai::ParameterEstimation::~ParameterEstimation ( )
inlinevirtual

Virtual destructor for deleting pointers to derived classes.

Member Function Documentation

virtual ParameterEstimation* dai::ParameterEstimation::clone ( ) const
pure virtual

Virtual copy constructor.

Implemented in dai::CondProbEstimation.

ParameterEstimation * dai::ParameterEstimation::construct ( const std::string &  method,
const PropertySet p 
)
static

General factory method that constructs the desired ParameterEstimation subclass.

Parameters
methodName of the subclass that should be constructed;
pParameters passed to constructor of subclass.
Note
method should either be in the default registry or should be registered first using registerMethod().
Exceptions
UNKNOWN_PARAMETER_ESTIMATION_METHODif the requested method is not registered.
static void dai::ParameterEstimation::registerMethod ( const std::string &  method,
const ParamEstFactory f 
)
inlinestatic

Register a subclass so that it can be used with construct().

virtual Prob dai::ParameterEstimation::estimate ( const Prob p)
inlinevirtual

Estimate the factor using the provided expectations.

virtual Prob dai::ParameterEstimation::parametersToFactor ( const Prob params)
pure virtual

Convert a set of estimated parameters to a factor.

Implemented in dai::CondProbEstimation.

virtual Prob dai::ParameterEstimation::parameters ( const Prob p)
pure virtual

Return parameters for the estimated factor, in a format specific to the parameter estimation.

Implemented in dai::CondProbEstimation.

virtual size_t dai::ParameterEstimation::probSize ( ) const
pure virtual

Returns the size of the Prob that should be passed to estimate and parameters.

Implemented in dai::CondProbEstimation.

void dai::ParameterEstimation::loadDefaultRegistry ( )
staticprivate

Registers default ParameterEstimation subclasses (currently, only CondProbEstimation).

Member Data Documentation

std::map< std::string, ParameterEstimation::ParamEstFactory > * dai::ParameterEstimation::_registry = NULL
staticprivate

A static registry containing all methods registered so far.


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