#include <RandomVar.h>
Inheritance diagram for PLearn::DiagonalNormalRandomVariable:
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 RandomVar & | mean () |
convenience inlines | |
const RandomVar & | log_variance () |
bool & | learn_the_mean () |
bool & | learn_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 |
|
DiagonalNormalRandomVariable *.
Definition at line 1855 of file RandomVar.cc. References Log2Pi, and PLearn::mean(). |
|
Implements PLearn::RandomVariable. Definition at line 1221 of file RandomVar.h. |
|
************ 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. |
|
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. |
|
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(). |
|
Definition at line 1233 of file RandomVar.h. Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate(). |
|
Definition at line 1234 of file RandomVar.h. Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate(). |
|
Definition at line 1232 of file RandomVar.h. Referenced by EMBprop(), EMUpdate(), logP(), and setValueFromParentsValue(). |
|
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(). |
|
convenience inlines
Definition at line 1231 of file RandomVar.h. Referenced by EMBprop(), EMUpdate(), logP(), and setValueFromParentsValue(). |
|
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(). |
|
denominator for mean and variance update in EM algorithm
Definition at line 1240 of file RandomVar.h. Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate(). |
|
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(). |
|
numerator for mean update in EM algorithm
Definition at line 1238 of file RandomVar.h. Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate(). |
|
normalization constant = dimension * log(2 PI)
Definition at line 1213 of file RandomVar.h. Referenced by logP(). |
|
iff log_variance->length()==1
Definition at line 1214 of file RandomVar.h. Referenced by EMBprop(), EMUpdate(), and logP(). |
|
numerator for variance update in EM algorithm
Definition at line 1239 of file RandomVar.h. Referenced by EMBprop(), EMEpochInitialize(), and EMUpdate(). |