public final class FeedForwardNetwork extends NeuralNetwork<BackpropagationTrainer>
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
Modifier and Type | Class and Description |
---|---|
static class |
FeedForwardNetwork.Builder
Builder of a
FeedForwardNetwork instance. |
Modifier and Type | Method and Description |
---|---|
static FeedForwardNetwork.Builder |
builder()
Returns a builder for the
FeedForwardNetwork |
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).
|
applyWeightChanges, backward, getInputLayer, getL1RegSum, getL2RegSum, getLabel, getLayers, getLossFunction, getNormalizer, getOutput, getOutputLabel, getOutputLabels, getOutputLayer, getPreprocessing, getTrainer, load, predict, save, setInput, setLabel, setLossFunction, setNormalizer, setOutputError, setOutputLabels, setPreprocessing, setTrainer, test, toString, train
public void setInput(float... inputs)
predict(float...)
since predict()
method sets given inputs and returns calculated outputs.
inputs
- array of inputs to the network given as array of float valuesIllegalArgumentException
- if size of the input vector does not match the number of the inputs of a networkpublic float[] predict(float... inputs)
inputs
- array of inputs to the network given as array of float valuesIllegalArgumentException
- if size of the input vector does not match the number of the inputs of a networkpublic float[] getOutput(float[] inputs)
inputs
- public static FeedForwardNetwork.Builder builder()
FeedForwardNetwork
Copyright © 2022. All rights reserved.