Package samer.models
Class DiffScaler
- java.lang.Object
-
- samer.tools.AnonymousTask
-
- samer.models.DiffScaler
-
public class DiffScaler extends AnonymousTask implements Model
Differential scaler: scales and offsets each element of a vector independently aiming to match a given prior model. This is like ICA using a diagonal weight matrix, with a 'zero-mean' normalisation built in, though it doesn't actually the mean to do this, but some statistic based on the prior model.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classDiffScaler.OffsetTrainerclassDiffScaler.ScaleTrainerclassDiffScaler.TensionedTrainerclassDiffScaler.Trainer
-
Constructor Summary
Constructors Constructor and Description DiffScaler(int N)DiffScaler(Vec input)DiffScaler(Vec input, Model M)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcompute()contract is that getEnergy and getGradient must return correct values for current x after infer and compute has been called, but not necessarily before.voiddispose()Functionxfunctionx()This presents a more functional interface to the model so that it can be driven by an optimiser.doublegetEnergy()return E = -log p(x)double[]getGradient()return dE/dxModel.TrainergetOffsetTrainer()ModelgetOutputModel()Model.TrainergetScaleTrainer()intgetSize()return size of vector this model expectsModel.TrainergetTensionedTrainer()Model.TrainergetTrainer()voidinfer()should infer values latent variablesVVectoroffsets()VVectoroutput()voidreset()voidreset(double k)voidrun()voidsetInput(Vec in)model should begin observing this vectorvoidsetOutputModel(Model m)voidstarting()voidstopping()java.lang.StringtoString()VVectorweights()
-
-
-
Constructor Detail
-
DiffScaler
public DiffScaler(int N)
-
DiffScaler
public DiffScaler(Vec input)
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:Modelreturn size of vector this model expects
-
output
public VVector output()
-
weights
public VVector weights()
-
offsets
public VVector offsets()
-
getOutputModel
public Model getOutputModel()
-
setOutputModel
public void setOutputModel(Model m)
-
setInput
public void setInput(Vec in)
Description copied from interface:Modelmodel should begin observing this vector
-
reset
public void reset()
-
reset
public void reset(double k)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
dispose
public void dispose()
-
infer
public void infer()
Description copied from interface:Modelshould infer values latent variables
-
compute
public void compute()
Description copied from interface:Modelcontract 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:Modelreturn E = -log p(x)
-
getGradient
public double[] getGradient()
Description copied from interface:Modelreturn dE/dx- Specified by:
getGradientin interfaceModel
-
functionx
public Functionx functionx()
Description copied from interface:ModelThis 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()
- Specified by:
startingin interfaceTask- Overrides:
startingin classAnonymousTask
-
stopping
public void stopping()
- Specified by:
stoppingin interfaceTask- Overrides:
stoppingin classAnonymousTask
-
getTrainer
public Model.Trainer getTrainer()
-
getOffsetTrainer
public Model.Trainer getOffsetTrainer()
-
getScaleTrainer
public Model.Trainer getScaleTrainer()
-
getTensionedTrainer
public Model.Trainer getTensionedTrainer()
-
-