Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::MultinomialRandomVariable Class Reference

#include <RandomVar.h>

Inheritance diagram for PLearn::MultinomialRandomVariable:

Inheritance graph
[legend]
Collaboration diagram for PLearn::MultinomialRandomVariable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MultinomialRandomVariable (const RandomVar &log_probabilities)
 MultinomialRandomVariable *.

const RandomVarlog_probabilities ()
 convenience inline

bool learn_the_probabilities ()
virtual char * classname ()
Var logP (const Var &obs, const RVInstanceArray &RHS, RVInstanceArray *parameters_to_learn)
void setValueFromParentsValue ()
 sampling algorithm

void EMUpdate ()
void EMBprop (const Vec obs, real posterior)
void EMEpochInitialize ()
 Initialization of an individual EMEpoch.

bool isDiscrete ()
 most common default


Protected Attributes

Vec sum_posteriors
 sum of posteriors over training data


Detailed Description

Y is discrete and takes values 0 to N-1. This class represents P(Y=i) = p_i where p=softmax(log_probabilities) and log_probabilities is the unique parent (which can be learned with "EM" in one iteration).

Definition at line 1472 of file RandomVar.h.


Constructor & Destructor Documentation

PLearn::MultinomialRandomVariable::MultinomialRandomVariable const RandomVar log_probabilities  ) 
 

MultinomialRandomVariable *.

Definition at line 2235 of file RandomVar.cc.


Member Function Documentation

virtual char* PLearn::MultinomialRandomVariable::classname  )  [inline, virtual]
 

Implements PLearn::RandomVariable.

Definition at line 1483 of file RandomVar.h.

void PLearn::MultinomialRandomVariable::EMBprop const Vec  obs,
real  posterior
[virtual]
 

************ EM STUFF ********** propagate posterior information to parents in order to perform an EMupdate at the end of an EMEpoch. In the case of mixture-like RVs and their components, the posterior is the probability of the component "this" given the observation "obs".

Implements PLearn::RandomVariable.

Definition at line 2261 of file RandomVar.cc.

References PLearn::TVec< T >::data(), learn_the_probabilities(), and sum_posteriors.

void PLearn::MultinomialRandomVariable::EMEpochInitialize  )  [virtual]
 

Initialization of an individual EMEpoch.

the default just propagates to the unmarked parents

Reimplemented from PLearn::RandomVariable.

Definition at line 2253 of file RandomVar.cc.

References PLearn::TVec< T >::clear(), learn_the_probabilities(), and sum_posteriors.

void PLearn::MultinomialRandomVariable::EMUpdate  )  [virtual]
 

update the fixed (non-random) parameters using internal learning mechanism, at end of an EMEpoch. the default just propagates to the unmarked parents.

Reimplemented from PLearn::RandomVariable.

Definition at line 2270 of file RandomVar.cc.

References PLearn::apply(), learn_the_probabilities(), log_probabilities(), PLearn::multiply(), PLearn::safeflog(), PLearn::sum(), and sum_posteriors.

bool PLearn::MultinomialRandomVariable::isDiscrete  )  [virtual]
 

most common default

Reimplemented from PLearn::StochasticRandomVariable.

Definition at line 2287 of file RandomVar.cc.

bool PLearn::MultinomialRandomVariable::learn_the_probabilities  )  [inline]
 

Definition at line 1481 of file RandomVar.h.

Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate().

const RandomVar& PLearn::MultinomialRandomVariable::log_probabilities  )  [inline]
 

convenience inline

Definition at line 1480 of file RandomVar.h.

Referenced by EMUpdate(), logP(), and setValueFromParentsValue().

Var PLearn::MultinomialRandomVariable::logP const Var obs,
const RVInstanceArray RHS,
RVInstanceArray parameters_to_learn
[virtual]
 

Construct a Var that computes logP(This = obs | RHS ). This function SHOULD NOT be used directly, but is called by the global function logP (same argument), which does proper massaging of the network before and after this call.

Implements PLearn::RandomVariable.

Definition at line 2241 of file RandomVar.cc.

References PLearn::log(), log_probabilities(), PLearn::logP(), PLearn::marginalize(), and PLearn::softmax().

void PLearn::MultinomialRandomVariable::setValueFromParentsValue  )  [virtual]
 

sampling algorithm

Implements PLearn::RandomVariable.

Definition at line 2292 of file RandomVar.cc.

References log_probabilities(), and PLearn::softmax().


Member Data Documentation

Vec PLearn::MultinomialRandomVariable::sum_posteriors [protected]
 

sum of posteriors over training data

Definition at line 1495 of file RandomVar.h.

Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:24:29 2004 for PLearn by doxygen 1.3.7