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

PLearn::DiagonalNormalRandomVariable Class Reference

#include <RandomVar.h>

Inheritance diagram for PLearn::DiagonalNormalRandomVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DiagonalNormalRandomVariable (const RandomVar &mean, const RandomVar &log_variance, real minimum_standard_deviation=1e-10)
 DiagonalNormalRandomVariable *.

virtual char * classname ()
Var logP (const Var &obs, const RVInstanceArray &RHS, RVInstanceArray *parameters_to_learn)
void setValueFromParentsValue ()
void EMUpdate ()
void EMBprop (const Vec obs, real posterior)
void EMEpochInitialize ()
 Initialization of an individual EMEpoch.

const RandomVarmean ()
 convenience inlines

const RandomVarlog_variance ()
boollearn_the_mean ()
boollearn_the_variance ()

Protected Attributes

real minimum_variance
real normfactor
 normalization constant = dimension * log(2 PI)

bool shared_variance
 iff log_variance->length()==1

Vec mu_num
 numerator for mean update in EM algorithm

Vec sigma_num
 numerator for variance update in EM algorithm

real denom
 denominator for mean and variance update in EM algorithm


Constructor & Destructor Documentation

PLearn::DiagonalNormalRandomVariable::DiagonalNormalRandomVariable const RandomVar mean,
const RandomVar log_var,
real  minimum_standard_deviation = 1e-10
 

DiagonalNormalRandomVariable *.

Definition at line 1855 of file RandomVar.cc.

References Log2Pi, and PLearn::mean().


Member Function Documentation

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

Implements PLearn::RandomVariable.

Definition at line 1221 of file RandomVar.h.

void PLearn::DiagonalNormalRandomVariable::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 1913 of file RandomVar.cc.

References PLearn::apply(), denom, PLearn::diffSquareMultiplyAcc(), PLearn::exp(), learn_the_mean(), learn_the_variance(), PLearn::RandomVariable::length(), log_variance(), mean(), minimum_variance, mu_num, PLearn::multiplyAcc(), PLERROR, PLearn::powdistance(), PLearn::pownorm(), shared_variance, sigma_num, PLearn::square_f(), PLearn::squareMultiplyAcc(), PLearn::substract(), and PLearn::Vec.

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

Initialization of an individual EMEpoch.

the default just propagates to the unmarked parents

Reimplemented from PLearn::RandomVariable.

Definition at line 1902 of file RandomVar.cc.

References PLearn::TVec< T >::clear(), denom, learn_the_mean(), learn_the_variance(), mu_num, and sigma_num.

void PLearn::DiagonalNormalRandomVariable::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 1964 of file RandomVar.cc.

References PLearn::apply(), denom, learn_the_mean(), learn_the_variance(), log_variance(), PLearn::max(), PLearn::mean(), mean(), minimum_variance, mu_num, PLearn::multiply(), PLearn::mv(), PLearn::safeflog(), shared_variance, sigma_num, and PLearn::substract().

bool& PLearn::DiagonalNormalRandomVariable::learn_the_mean  )  [inline]
 

Definition at line 1233 of file RandomVar.h.

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

bool& PLearn::DiagonalNormalRandomVariable::learn_the_variance  )  [inline]
 

Definition at line 1234 of file RandomVar.h.

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

const RandomVar& PLearn::DiagonalNormalRandomVariable::log_variance  )  [inline]
 

Definition at line 1232 of file RandomVar.h.

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

Var PLearn::DiagonalNormalRandomVariable::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 1864 of file RandomVar.cc.

References PLearn::exp(), PLearn::log(), log_variance(), PLearn::logP(), PLearn::marginalize(), mean(), minimum_variance, normfactor, shared_variance, PLearn::square(), PLearn::sum(), and PLearn::variance().

const RandomVar& PLearn::DiagonalNormalRandomVariable::mean  )  [inline]
 

convenience inlines

Definition at line 1231 of file RandomVar.h.

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

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

define the formula that gives a value to this RV given its parent's value (sets the value field). If the RV is stochastic, the formula may also be "stochastic" (using SampleVariable's to define the Var).

Implements PLearn::RandomVariable.

Definition at line 1894 of file RandomVar.cc.

References PLearn::exp(), log_variance(), mean(), minimum_variance, and PLearn::sqrt().


Member Data Documentation

real PLearn::DiagonalNormalRandomVariable::denom [protected]
 

denominator for mean and variance update in EM algorithm

Definition at line 1240 of file RandomVar.h.

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

real PLearn::DiagonalNormalRandomVariable::minimum_variance [protected]
 

mean = parents[0] log_variance = parents[1] variance = minimum_variance + exp(log_variance);

Definition at line 1212 of file RandomVar.h.

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

Vec PLearn::DiagonalNormalRandomVariable::mu_num [protected]
 

numerator for mean update in EM algorithm

Definition at line 1238 of file RandomVar.h.

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

real PLearn::DiagonalNormalRandomVariable::normfactor [protected]
 

normalization constant = dimension * log(2 PI)

Definition at line 1213 of file RandomVar.h.

Referenced by logP().

bool PLearn::DiagonalNormalRandomVariable::shared_variance [protected]
 

iff log_variance->length()==1

Definition at line 1214 of file RandomVar.h.

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

Vec PLearn::DiagonalNormalRandomVariable::sigma_num [protected]
 

numerator for variance update in EM algorithm

Definition at line 1239 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:24 2004 for PLearn by doxygen 1.3.7