public class NEFEnsembleFactoryImpl extends java.lang.Object implements NEFEnsembleFactory, java.io.Serializable
Constructor and Description |
---|
NEFEnsembleFactoryImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultOrigins(NEFEnsemble ensemble)
Adds standard decoded Origins to the given NEFEnsemble
This method is exposed so that it can be over-ridden to change behaviour.
|
void |
beQuiet()
Stops the factory from printing out information to console during make process.
|
protected NEFEnsemble |
construct(java.lang.String name,
NEFNode[] nodes,
float[][] encoders,
ApproximatorFactory af,
float[][] evalPoints,
float[] radii)
This method is exposed so that it can be over-ridden to change behaviour.
|
ApproximatorFactory |
getApproximatorFactory() |
java.io.File |
getDatabase() |
VectorGenerator |
getEncoderFactory() |
VectorGenerator |
getEvalPointFactory() |
NodeFactory |
getNodeFactory() |
protected int |
getNumEvalPoints(int dim)
This method is exposed so that it can be over-ridden to change behaviour.
|
NEFEnsemble |
make(java.lang.String name,
int n,
float[] radii) |
NEFEnsemble |
make(java.lang.String name,
int n,
float[] radii,
java.lang.String storageName,
boolean overwrite)
Loads an NEFEnsemble, or creates and saves it.
|
NEFEnsemble |
make(java.lang.String name,
int n,
int dim) |
NEFEnsemble |
make(java.lang.String name,
int n,
int dim,
java.lang.String storageName,
boolean overwrite)
Loads an NEFEnsemble, or creates and saves it.
|
void |
setApproximatorFactory(ApproximatorFactory factory) |
void |
setDatabase(java.io.File database) |
void |
setEncoderFactory(VectorGenerator factory) |
void |
setEvalPointFactory(VectorGenerator factory) |
void |
setNodeFactory(NodeFactory factory) |
public NEFEnsembleFactoryImpl()
public ApproximatorFactory getApproximatorFactory()
getApproximatorFactory
in interface NEFEnsembleFactory
NEFEnsembleFactory.getApproximatorFactory()
public VectorGenerator getEncoderFactory()
getEncoderFactory
in interface NEFEnsembleFactory
NEFEnsembleFactory.getEncoderFactory()
public VectorGenerator getEvalPointFactory()
getEvalPointFactory
in interface NEFEnsembleFactory
NEFEnsembleFactory.getEvalPointFactory()
public NodeFactory getNodeFactory()
getNodeFactory
in interface NEFEnsembleFactory
NEFEnsembleFactory.getNodeFactory()
public void beQuiet()
public NEFEnsemble make(java.lang.String name, int n, int dim) throws StructuralException
make
in interface NEFEnsembleFactory
name
- Name of the NEFEnsemblen
- Number of neurons in the ensembledim
- Dimension of the ensemble.StructuralException
- if there is any error attempting to create the ensembleNEFEnsembleFactory.make(java.lang.String, int, int)
public NEFEnsemble make(java.lang.String name, int n, float[] radii) throws StructuralException
make
in interface NEFEnsembleFactory
name
- Name of the NEFEnsemblen
- Number of neurons in the ensembleradii
- Radius of encoded region in each dimensionStructuralException
- if there is any error attempting to create the ensembleNEFEnsembleFactory.make(java.lang.String, int, float[])
public NEFEnsemble make(java.lang.String name, int n, int dim, java.lang.String storageName, boolean overwrite) throws StructuralException
NEFEnsembleFactory
make
in interface NEFEnsembleFactory
name
- Name of the NEFEnsemblen
- Number of neurons in the ensembledim
- Dimension of the ensemble.storageName
- Name for storage (eg filename, db key; may have to be more fully qualified than
name param, if ensembles belonging to multiple networks are stored in the same place)overwrite
- If false, loads the ensemble if it can be found in storage.
If true, creates a new ensemble regardless and overwrites any existing ensemble.StructuralException
- if there is any error attempting to create the ensembleNEFEnsembleFactory.make(java.lang.String, int, int, java.lang.String, boolean)
public NEFEnsemble make(java.lang.String name, int n, float[] radii, java.lang.String storageName, boolean overwrite) throws StructuralException
NEFEnsembleFactory
make
in interface NEFEnsembleFactory
name
- Name of the NEFEnsemblen
- Number of neurons in the ensembleradii
- Radius of encoded region in each dimension.storageName
- Name for storage (eg filename, db key; may have to be more fully qualified than
name param, if ensembles belonging to multiple networks are stored in the same place)overwrite
- If false, loads the ensemble if it can be found in storage.
If true, creates a new ensemble regardless and overwrites any existing ensemble.StructuralException
- if there is any error attempting to create the ensembleNEFEnsembleFactory.make(java.lang.String, int, int, java.lang.String, boolean)
public void setApproximatorFactory(ApproximatorFactory factory)
setApproximatorFactory
in interface NEFEnsembleFactory
factory
- A factory for creating the LinearApproximators used in decoding ensemble outputNEFEnsembleFactory.setApproximatorFactory(ca.nengo.math.ApproximatorFactory)
public void setEncoderFactory(VectorGenerator factory)
setEncoderFactory
in interface NEFEnsembleFactory
factory
- A VectorGenerator to be used to create encoding vectors that are associated
with each Node in a new EnsembleNEFEnsembleFactory.setEncoderFactory(ca.nengo.util.VectorGenerator)
public void setEvalPointFactory(VectorGenerator factory)
setEvalPointFactory
in interface NEFEnsembleFactory
factory
- A VectorGenerator to be used to generate the vector states at which decoding
functions are evaluatedNEFEnsembleFactory.setEvalPointFactory(ca.nengo.util.VectorGenerator)
public void setNodeFactory(NodeFactory factory)
setNodeFactory
in interface NEFEnsembleFactory
factory
- NodeFactory to be used to create Nodes that make up new EnsemblesNEFEnsembleFactory.setNodeFactory(ca.nengo.model.impl.NodeFactory)
protected int getNumEvalPoints(int dim)
dim
- the dimension of the state represented by an Ensembleprotected NEFEnsemble construct(java.lang.String name, NEFNode[] nodes, float[][] encoders, ApproximatorFactory af, float[][] evalPoints, float[] radii) throws StructuralException
name
- Name of new Ensemblenodes
- Nodes that make up Ensembleencoders
- Encoding vector for each Nodeaf
- Factory that produces LinearApproximators for decoding Ensemble outputevalPoints
- States at which Node output is evaluated for decoding purposesradii
- Radius of encoded area in each dimensionStructuralException
protected void addDefaultOrigins(NEFEnsemble ensemble) throws StructuralException
ensemble
- A new NEFEnsembleStructuralException
public java.io.File getDatabase()
public void setDatabase(java.io.File database)
database
- New directory for saving / loading ensembles