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 class
SparseICA.ON2Trainer
This trainer uses an O(N^2) run step and an O(N^2) flush.class
SparseICA.ON3Trainer
This 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 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()
void
execute(java.lang.String cmd, Environment env)
Functionx
functionx()
This presents a more functional interface to the model so that it can be driven by an optimiser.Model.Trainer
getAltTrainer()
void
getCommands(Registry r)
double
getEnergy()
return E = -log p(x)double[]
getGradient()
return dE/dxModel
getOutputModel()
int
getSize()
return size of vector this model expectsModel.Trainer
getTrainer()
SparseMatrix
getWeightMatrix()
void
infer()
should infer values latent variablesvoid
init1(Matrix R, int M)
x is an N-dim vector.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.VVector
output()
void
run()
void
setInput(Vec input)
model should begin observing this vectorvoid
setOutputModel(Model m)
void
starting()
void
stopping()
-
-
-
Constructor Detail
-
SparseICA
public SparseICA(int N)
-
SparseICA
public SparseICA(Vec input)
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:Model
return 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:Model
model should begin observing this vector
-
getWeightMatrix
public SparseMatrix getWeightMatrix()
-
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()
- Specified by:
starting
in interfaceTask
- Overrides:
starting
in classAnonymousTask
-
stopping
public void stopping()
- Specified by:
stopping
in interfaceTask
- Overrides:
stopping
in 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.
-
-