Package samer.models
Class IIDPrior
- java.lang.Object
-
- samer.tools.AnonymousTask
-
- samer.models.IIDPrior
-
public class IIDPrior extends AnonymousTask implements Model
Non adaptive model of vector in which each component is independent of the others and all are identically distributed according to a given prior- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface samer.models.Model
Model.Trainer
-
-
Constructor Summary
Constructors Constructor and Description IIDPrior(int n)
IIDPrior(int N, Function f)
IIDPrior(Vec in)
IIDPrior(Vec in, Function E)
-
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)VDouble
getEnergySignal()
VVector
getEnergyVector()
double[]
getGradient()
return dE/dxint
getSize()
return size of vector this model expectsvoid
infer()
should infer values latent variablesvoid
run()
void
setInput(Vec input)
model should begin observing this vectorvoid
setLogPrior(Function f)
java.lang.String
toString()
-
Methods inherited from class samer.tools.AnonymousTask
starting, stopping
-
-
-
-
Constructor Detail
-
IIDPrior
public IIDPrior(int n)
-
IIDPrior
public IIDPrior(int N, Function f)
-
IIDPrior
public IIDPrior(Vec in)
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:Model
return size of vector this model expects
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
dispose
public void dispose()
-
setInput
public void setInput(Vec input)
Description copied from interface:Model
model should begin observing this vector
-
setLogPrior
public void setLogPrior(Function f)
-
getEnergyVector
public VVector getEnergyVector()
-
getEnergySignal
public VDouble getEnergySignal()
-
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
-
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.
-
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.
-
-