Package samer.models
Class SparseICA
- java.lang.Object
-
- samer.tools.AnonymousTask
-
- samer.tools.NamedTask
-
- samer.models.SparseICA
-
public class SparseICA extends NamedTask implements Model
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classSparseICA.ON2TrainerThis trainer uses an O(N^2) run step and an O(N^2) flush.classSparseICA.ON3TrainerThis trainer saves on an O(N^2) step during accumulation, at the expense of an O(N^3) flush.-
Nested classes/interfaces inherited from interface samer.models.Model
Model.Trainer
-
-
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()voidexecute(java.lang.String cmd, Environment env)Functionxfunctionx()This presents a more functional interface to the model so that it can be driven by an optimiser.Model.TrainergetAltTrainer()voidgetCommands(Registry r)doublegetEnergy()return E = -log p(x)double[]getGradient()return dE/dxModelgetOutputModel()intgetSize()return size of vector this model expectsModel.TrainergetTrainer()SparseMatrixgetWeightMatrix()voidinfer()should infer values latent variablesvoidinit1(Matrix R, int M)x is an N-dim vector.voidinit2(Matrix R)This version only builds disjoint butterfly pairs, ie only 2N edges per layer Need a version that builds bigger local modules.VVectoroutput()voidrun()voidsetInput(Vec input)model should begin observing this vectorvoidsetOutputModel(Model m)voidstarting()voidstopping()
-
-
-
Constructor Detail
-
SparseICA
public SparseICA(int N)
-
SparseICA
public SparseICA(Vec input)
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:Modelreturn size of vector this model expects
-
output
public VVector output()
-
getOutputModel
public Model getOutputModel()
-
setOutputModel
public void setOutputModel(Model m)
-
setInput
public void setInput(Vec input)
Description copied from interface:Modelmodel should begin observing this vector
-
getWeightMatrix
public SparseMatrix getWeightMatrix()
-
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
-
getCommands
public void getCommands(Registry r)
-
execute
public void execute(java.lang.String cmd, Environment env)
-
getTrainer
public Model.Trainer getTrainer()
-
getAltTrainer
public Model.Trainer getAltTrainer()
-
init1
public void init1(Matrix R, int M)
x is an N-dim vector. R is an N by N symmetric similarity matrix. M is number of unit pairs (butterflies) build into ICA model
-
init2
public void init2(Matrix R)
This version only builds disjoint butterfly pairs, ie only 2N edges per layer Need a version that builds bigger local modules.
-
-