Package samer.models
Class Mixture
- java.lang.Object
-
- samer.tools.AnonymousTask
-
- samer.tools.NamedTask
-
- samer.models.Mixture
-
public class Mixture extends NamedTask implements Model
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description class
Mixture.Trainer
-
Constructor Summary
Constructors Constructor and Description Mixture(int N, int L)
Mixture(Vec input, int m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
compute()
contract is that getEnergy and getGradient must return correct values for current x after infer and compute has been called, but not necessarily before.void
dispose()
Functionx
functionx()
This presents a more functional interface to the model so that it can be driven by an optimiser.double
getEnergy()
return E = -log p(x)double[]
getGradient()
return dE/dxint
getSize()
return size of vector this model expectsMixture.Trainer
getTrainer()
void
infer()
should infer values latent variablesVVector
posterior()
VVector
prior()
void
run()
void
setInput(Vec in)
model should begin observing this vectorvoid
setModel(int i, Model m)
-
Methods inherited from class samer.tools.AnonymousTask
starting, stopping
-
-
-
-
Constructor Detail
-
Mixture
public Mixture(int N, int L)
-
Mixture
public Mixture(Vec input, int m)
-
-
Method Detail
-
prior
public VVector prior()
-
posterior
public VVector posterior()
-
setModel
public void setModel(int i, Model m)
-
setInput
public void setInput(Vec in)
Description copied from interface:Model
model should begin observing this vector
-
getSize
public int getSize()
Description copied from interface:Model
return size of vector this model expects
-
dispose
public void dispose()
-
infer
public void infer()
Description copied from interface:Model
should infer values latent variables
-
compute
public void compute()
Description copied from interface:Model
contract is that getEnergy and getGradient must return correct values for current x after infer and compute has been called, but not necessarily before. This is to give model an opportunity to cache values of energy and gradient to avoid repeated computations.
-
getEnergy
public double getEnergy()
Description copied from interface:Model
return E = -log p(x)
-
getGradient
public double[] getGradient()
Description copied from interface:Model
return dE/dx- Specified by:
getGradient
in interfaceModel
-
functionx
public Functionx functionx()
Description copied from interface:Model
This presents a more functional interface to the model so that it can be driven by an optimiser. See classes Functionx and MinimiserBase in package samer.maths.opt.
-
getTrainer
public Mixture.Trainer getTrainer()
-
-