Package deepnetts.net
Class FeedForwardNetwork
- All Implemented Interfaces:
TrainerProvider<BackpropagationTrainer>
,Serializable
Feed forward neural network architecture, also known as Multi Layer Perceptron.
It consists of a sequence of neural network layers
deepnetts.net.layers
trained by Back-propagation BackpropagationTrainer
algorithm.
As a minimum network must have input InputLayer
and output layer OutputLayer
.
For non-trivial problems it will also need several hidden fully connected layers FullyConnectedLayer
.
The easiest and recommended way to create an instance of a neural network is by using FeedForwardNetwork.Builder
This type of network can be used for both classification and regression tasks depending how it is configured.
For a quick explanation about essential principles behind feed forward neural networks see the tutorial From Basic Machine Learning to Deep Learning in 5 Minutes
For a quick overview of machine learning basics required to understand Feed Forward Network see Machine Learning Tutorial for Java Developers
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic FeedForwardNetwork.Builder
builder()
Returns a builder for theFeedForwardNetwork
float[]
getOutput
(float[] inputs) Deprecated.float[]
predict
(float... inputs) Returns the network's prediction (outputs) for the given input.void
setInput
(float... inputs) Sets network's input using given inputs and invokes the calculation of the network for the given input (forward pass).Methods inherited from class deepnetts.net.NeuralNetwork
applyWeightChanges, backward, getInputLayer, getL1RegSum, getL2RegSum, getLabel, getLayerAt, getLayers, getLossFunction, getMode, getNormalizer, getOutput, getOutputLabel, getOutputLabels, getOutputLayer, getPreprocessing, getThreadPool, getTrainer, load, predict, save, setInput, setLabel, setLossFunction, setMode, setNormalizer, setOutputError, setOutputLabels, setPreprocessing, setTrainer, test, toString, train
-
Method Details
-
setInput
public void setInput(float... inputs) Sets network's input using given inputs and invokes the calculation of the network for the given input (forward pass). This method is usually used only during the training. You don't have to use it before the call topredict(float...)
sincepredict()
method sets given inputs and returns calculated outputs.
- Parameters:
inputs
- array of inputs to the network given as array of float values- Throws:
IllegalArgumentException
- if size of the input vector does not match the number of the inputs of a network
-
predict
public float[] predict(float... inputs) Returns the network's prediction (outputs) for the given input.- Parameters:
inputs
- array of inputs to the network given as array of float values- Returns:
- model's prediction as network's output
- Throws:
IllegalArgumentException
- if size of the input vector does not match the number of the inputs of a network
-
getOutput
public float[] getOutput(float[] inputs) Deprecated.Returns network output for the given input. This method is deprecated and predict method should be used instead.- Parameters:
inputs
-- Returns:
-
builder
Returns a builder for theFeedForwardNetwork
- Returns:
- builder instance
-