|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.classifier.neural.model.BasicNeuralNet
public class BasicNeuralNet
Implementation of basic neural network. The network consists of one input layer,
zero or more hidden layers and one output layer. Each layer contains 1 or more
Neuron
units. The input layer is used just to store and forward input
pattern of the network to first hidden layer for processing.
Input layer do not process input pattern. Neurons of input layer have one input weight
equal to 1, bias weight equal to 0 and use linear activation function.
Constructor Summary | |
---|---|
BasicNeuralNet(int[] netTopology,
double biasInput,
Class<? extends ActivationFunction> activationFunction,
Random random)
Creates a new BasicNeuralNet instance. |
Method Summary | |
---|---|
double[] |
feedForward(double[] inputPattern)
Propagates the input pattern through the network. |
int |
getLayersCount()
Returns a total number of layers of the neural network. |
List<Neuron> |
getLayerUnits(int layerIndex)
Returns units of a particular layer of the neural network. |
int |
getNetInputSize()
Gets the size/dimension of the input layer of the neural network. |
int |
getNetOutputSize()
Gets the size/dimension of the output layer of the neural network. |
double[] |
getOutput()
Returns the actual output of the neural network, which is a result of last processed input pattern. |
void |
reset()
Perform reset, re-initialization of neural network. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicNeuralNet(int[] netTopology, double biasInput, Class<? extends ActivationFunction> activationFunction, Random random)
BasicNeuralNet
instance.
netTopology
- defines a topology of the network. The array length corresponds
to number of network layers. The values of the array corresponds to number
of neurons in each particular layer.biasInput
- the bias input value for neurons of the neural network.activationFunction
- the type of activation function to be used by network elementsrandom
- the pseudo-random generator instance to be used for computations involving randomness.
This parameter can be null. In this case, new random instance with default seed will be constructed where needed.
IllegalArgumentException
- if network topology is incorrect of activation function class is null.Method Detail |
---|
public List<Neuron> getLayerUnits(int layerIndex)
NeuralNet
getLayerUnits
in interface NeuralNet
Collections.unmodifiableList(List)
public int getLayersCount()
NeuralNet
getLayersCount
in interface NeuralNet
public double[] feedForward(double[] inputPattern)
NeuralNet
feedForward
in interface NeuralNet
inputPattern
- the input pattern for the network to process
public double[] getOutput()
NeuralNet
getOutput
in interface NeuralNet
public void reset()
NeuralNet
reset
in interface NeuralNet
public int getNetInputSize()
NeuralNet
getNetInputSize
in interface NeuralNet
public int getNetOutputSize()
NeuralNet
getNetOutputSize
in interface NeuralNet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |