Package samer.models
Class Scaler
- java.lang.Object
-
- samer.tools.NullTask
-
- samer.models.Scaler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description class
Scaler.OffsetTrainer
This trains only the offset, not the scaleclass
Scaler.ScaleTrainer
class
Scaler.Trainer
-
Constructor Summary
Constructors Constructor and Description Scaler(int N)
Scaler(Vec input)
Scaler(Vec input, Model 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/dxVDouble
getOffset()
Scaler.OffsetTrainer
getOffsetTrainer()
Model
getOutputModel()
VDouble
getScale()
Scaler.ScaleTrainer
getScaleTrainer()
int
getSize()
return size of vector this model expectsScaler.Trainer
getTrainer()
void
infer()
should infer values latent variablesVVector
output()
void
reset()
void
run()
void
setInput(Vec in)
model should begin observing this vectorvoid
setOutputModel(Model m)
void
starting()
void
stopping()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Scaler
public Scaler(int N)
-
Scaler
public Scaler(Vec input)
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:Model
return size of vector this model expects
-
output
public VVector output()
-
getScale
public VDouble getScale()
-
getOffset
public VDouble getOffset()
-
getOutputModel
public Model getOutputModel()
-
setOutputModel
public void setOutputModel(Model m)
-
setInput
public void setInput(Vec in)
Description copied from interface:Model
model should begin observing this vector
-
reset
public void reset()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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.
-
starting
public void starting()
-
stopping
public void stopping()
-
run
public void run()
-
getTrainer
public Scaler.Trainer getTrainer()
-
getOffsetTrainer
public Scaler.OffsetTrainer getOffsetTrainer()
-
getScaleTrainer
public Scaler.ScaleTrainer getScaleTrainer()
-
-