The methods of a neural network.
Get the prediction for an input:
net.predict(List(0.4, 0.05, 0.2))
Fit network to a single observation:
net.fit(0.1, List(0.4, 0.05, 0.2), List(0.03. 0.8))
Get the JSON representation of the network:
net.json()
- Companion
- object
Value members
Concrete methods
Returns the neural network with its weights adjusted to the provided observation.
Returns the neural network with its weights adjusted to the provided observation.
In order for it to be trained, it should fit with multiple observations, usually by folding over an iterator.
- Value Params
- expectedOutput
The expected output of the observation. It's size should be equal to the size of the output layer.
- inputValues
The features values of the observation.
- learningRate
A number that controls how much the weights are adjusted to the observation.
- Returns
A new neural network that has the same shape of the original, but it has learned from a single observation.
The JSON representation of the neural network.
The JSON representation of the neural network.
- Returns
The JSON representation of the neural network.
Returns the neural network with its weights adjusted to the provided observation.
Returns the neural network with its weights adjusted to the provided observation.
The calculation is performed in parallel. When the neural network has huge layers, the parallel calculation boosts the perforamnce.
- Value Params
- expectedOutput
The expected output of the observation. It's size should be equal to the size of the output layer.
- inputValues
The features values of the observation.
- learningRate
A number that controls how much the weights are adjusted to the observation.
- Returns
A new neural network that has the same shape of the original, but it has learned from a single observation.
Makes a prediction for the provided input.
Makes a prediction for the provided input.
The calculation is performed in parallel. When the neural network has huge layers, the parallel calculation boosts the perforamnce.
- Value Params
- inputValues
The values of the features. Their size should be equal to the size of the input layer.
- Returns
The prediction. It's size should be equal to the size of the output layer.
Makes a prediction for the provided input.
Makes a prediction for the provided input.
- Value Params
- inputValues
The values of the features. Their size should be equal to the size of the input layer.
- Returns
The prediction. It's size should be equal to the size of the output layer.