public class NetFactory
extends java.lang.Object
NeuralNet and adding Neuron and Link objects.| Constructor and Description |
|---|
NetFactory() |
| Modifier and Type | Method and Description |
|---|---|
static SpikingNeuralNet |
createFeedForward(int[] neuronsPerLayer,
boolean full,
SpikingNeuron neuron,
SpikingLink link)
Create a feed-forward spiking net.
|
static NeuralNet |
createFeedForward(int[] neuronsPerLayer,
boolean full,
Trainer trainer,
Neuron neuron,
Link link)
Create a standard feed-forward network.
|
static NeuralNet |
createFeedForward(java.util.List<Layer> layers,
Trainer trainer,
boolean random)
Creates a feed-forward network with connections between neighboring layers.
|
static SpikingNeuralNet |
createHopfield(int numNeurons,
Function neuronAF,
Function linkAF,
Trainer trainer,
Neuron neuron,
Link link)
Create a recurrent spiking neural network (e.g.
|
static NeuralNet |
createHopfield(int numNeurons,
Function activationFunctionTemplate,
Trainer trainerTemplate,
Neuron neuronTemplate,
Link linkTemplate)
Creates a a Hopfield network, where each neuron is connected to every other.
|
static NeuralNet |
createSOM(SOMTrainer trainer,
PatternSet patterns)
The master method for creating a SOM net.
|
public static NeuralNet createFeedForward(int[] neuronsPerLayer, boolean full, Trainer trainer, Neuron neuron, Link link)
neuronsPerLayer - number of neurons per layer, the first and the last layer are
input and output layers, and the layers in between are hidden.full - if true, the network will be fully connected, i.e. all potential feed-forward
connections are made resulting in a GMLP
(i.e. for a 3-layer-net: input - hidden, hidden - output, input - output).trainer - template for the network trainer
if null, an RPropTrainer will be created as the network trainerneuron - template for creating the neurons. The network's neurons will
be created with the clone() method. If null, a standard neuron will be createdlink - template for creating the links, the network's links will
be created with the clone() method, if null, a standard link will be createdpublic static NeuralNet createFeedForward(java.util.List<Layer> layers, Trainer trainer, boolean random)
layers - a list of layers starting with the input layertrainer - template for the network trainer
if null, an RPropTrainer will be created as the network trainerrandom - true, if weights and biases are to be randomizedpublic static SpikingNeuralNet createFeedForward(int[] neuronsPerLayer, boolean full, SpikingNeuron neuron, SpikingLink link)
neuronsPerLayer - Number of neurons per layer. the first and the last layer are
input and output layers, and the layers in between are hidden.full - If true, the network will be fully connected, i.e. all layers
will be interconnected in the forward direction.
(i.e. for a 3-layer-net: input - hidden, hidden - output, input - output).neuron - Template for creating the spiking neurons. The network's neurons will
be created with the clone() method (if you use a derived spiking neuron class, please
remember to make a suitable one!). If null, a SpikingNeuron will be created.link - Template for creating the spiking links. The network's links will
be created with the clone() method (if you use a derived spiking link class, please
remember to make a suitable one!). If null, a SpikingLink will be created.public static NeuralNet createSOM(SOMTrainer trainer, PatternSet patterns)
trainer - a SOM trainerpatterns - the patterns to be mappedpublic static NeuralNet createHopfield(int numNeurons, Function activationFunctionTemplate, Trainer trainerTemplate, Neuron neuronTemplate, Link linkTemplate)
numNeurons - number of neuronsactivationFunctionTemplate - Template for the activation functions of the neurons.
If null, then the default (AtLeast 0) will be usedtrainerTemplate - Template object for the network trainer. If null,
a HopfieldDeltaTrainer will be used.neuronTemplate - A template for creating the neurons. The network's neurons will
be created with the clone() method. If null, a standard neuron will be created.linkTemplate - A template for creating the links. The network's links will
be created with the clone() method. If null, a standard link will be created.public static SpikingNeuralNet createHopfield(int numNeurons, Function neuronAF, Function linkAF, Trainer trainer, Neuron neuron, Link link)
Sets maxCycles to 100.
Every link has the directed flag enabled. Weights will be initialized with 1. Delays for the links will be initialized with random values in the specified interval.
numNeurons - How many neurons should be created.neuronAF - Template object for the activation functions of
the neurons. If null, then the Spike function will be used.linkAF - Template object for the activation functions of
the links. If null, then the PostsynapticPotential function will be used.trainer - the trainer (there is no Boone trainer for SNN currently)neuron - Template for creating the spiking neurons. The network's neurons will
be created with the clone() method (if you use a derived spiking neuron class, please
remember to make a suitable one!). If null, a SpikingNeuron will be created.link - Template for creating the spiking links. The network's links will
be created with the clone() method (if you use a derived spiking link class, please
remember to make a suitable one!). If null, a SpikingLink will be created. @return a recurrent network.