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

PLearn::PlusRandomVariable Class Reference

#include <RandomVar.h>

Inheritance diagram for PLearn::PlusRandomVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PlusRandomVariable (RandomVar input1, RandomVar input2)
 RandomVariable Plus *.

virtual char * classname ()
void setValueFromParentsValue ()
 set the field value from the values of the parents

bool invertible (const Var &obs, RVInstanceArray &unobserved_parents, Var **JacobianCorrection)
 !< SUBCLASS WRITERS: IMPLEMENT FUNCTIONS BELOW //!<

void EMBprop (const Vec obs, real post)
void EMTrainingInitialize (const RVArray &parameters_to_learn)
 Initialization of EM training (before all the iterations start).

void EMEpochInitialize ()
 Initialization of an individual EMEpoch.

void EMUpdate ()
const RandomVarX0 ()
 convenience inline's

const RandomVarX1 ()
bool learn_X0 ()
 stuff for EM

bool learn_X1 ()

Public Attributes

bool learn_something
RandomVar parent_to_learn
 the one of X0 or X1 that is to learn

RandomVar other_parent
 the other one

Vec numerator
Vec difference
real denom

Detailed Description

Y = X0 + X1

if both X0 and X1 are observed, and one of them is learnable, then it can be learned by EM.

Definition at line 1293 of file RandomVar.h.


Constructor & Destructor Documentation

PLearn::PlusRandomVariable::PlusRandomVariable RandomVar  input1,
RandomVar  input2
 

RandomVariable Plus *.

Definition at line 1309 of file RandomVar.cc.

References PLearn::difference(), MAX, and PLERROR.


Member Function Documentation

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

Implements PLearn::RandomVariable.

Definition at line 1298 of file RandomVar.h.

void PLearn::PlusRandomVariable::EMBprop const Vec  obs,
real  post
[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 1374 of file RandomVar.cc.

References denom, difference, learn_something, PLearn::multiplyAcc(), numerator, other_parent, parent_to_learn, PLearn::substract(), X0(), and X1().

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

Initialization of an individual EMEpoch.

the default just propagates to the unmarked parents

Reimplemented from PLearn::RandomVariable.

Definition at line 1363 of file RandomVar.cc.

References PLearn::TVec< T >::clear(), denom, learn_something, and numerator.

void PLearn::PlusRandomVariable::EMTrainingInitialize const RVArray parameters_to_learn  )  [virtual]
 

Initialization of EM training (before all the iterations start).

the default just propagates to the unmarked parents

Reimplemented from PLearn::RandomVariable.

Definition at line 1342 of file RandomVar.cc.

References learn_something, learn_X0(), learn_X1(), other_parent, parent_to_learn, PLERROR, X0(), and X1().

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

References denom, learn_something, learn_X0(), learn_X1(), PLearn::multiply(), numerator, parent_to_learn, X0(), and X1().

bool PLearn::PlusRandomVariable::invertible const Var obs,
RVInstanceArray unobserved_parents,
Var **  JacobianCorrection
[virtual]
 

!< SUBCLASS WRITERS: IMPLEMENT FUNCTIONS BELOW //!<

check whether it is possible to invert the function which maps the given unobserved parents to the observed value of the RV (obs). If invertible, do the inversion, and set the value fields of the RVInstances to Var's which are functionally dependent on obs. If the absolute value of the Jacobian of the map from the unobserved parents to this R.V.'s value is different from 1, then JacobianCorrection should point to a Var that is the logarithm of the determinant of this Jacobian (first derivatives) matrix. If the function is not invertible but it is possible to write P(Y==obs | unobserved_parents) in terms of the unobserved_parents logP functions, then the sub-class writer should instead redefine the logP function appropriately.

Reimplemented from PLearn::FunctionalRandomVariable.

Definition at line 1327 of file RandomVar.cc.

References PLearn::TVec< RVInstance >::size(), X0(), and X1().

bool PLearn::PlusRandomVariable::learn_X0  )  [inline]
 

stuff for EM

Definition at line 1313 of file RandomVar.h.

Referenced by EMTrainingInitialize(), and EMUpdate().

bool PLearn::PlusRandomVariable::learn_X1  )  [inline]
 

Definition at line 1314 of file RandomVar.h.

Referenced by EMTrainingInitialize(), and EMUpdate().

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

set the field value from the values of the parents

Implements PLearn::FunctionalRandomVariable.

Definition at line 1321 of file RandomVar.cc.

References X0(), and X1().

const RandomVar& PLearn::PlusRandomVariable::X0  )  [inline]
 

convenience inline's

Definition at line 1309 of file RandomVar.h.

Referenced by EMBprop(), EMTrainingInitialize(), EMUpdate(), invertible(), and setValueFromParentsValue().

const RandomVar& PLearn::PlusRandomVariable::X1  )  [inline]
 

Definition at line 1310 of file RandomVar.h.

Referenced by EMBprop(), EMTrainingInitialize(), EMUpdate(), invertible(), and setValueFromParentsValue().


Member Data Documentation

real PLearn::PlusRandomVariable::denom
 

Definition at line 1320 of file RandomVar.h.

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

Vec PLearn::PlusRandomVariable::difference
 

Definition at line 1319 of file RandomVar.h.

Referenced by EMBprop().

bool PLearn::PlusRandomVariable::learn_something
 

Definition at line 1315 of file RandomVar.h.

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

Vec PLearn::PlusRandomVariable::numerator
 

Definition at line 1318 of file RandomVar.h.

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

RandomVar PLearn::PlusRandomVariable::other_parent
 

the other one

Definition at line 1317 of file RandomVar.h.

Referenced by EMBprop(), and EMTrainingInitialize().

RandomVar PLearn::PlusRandomVariable::parent_to_learn
 

the one of X0 or X1 that is to learn

Definition at line 1316 of file RandomVar.h.

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


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