public class OutputLayer extends Layer
Constructor and Description |
---|
OutputLayer(int n,
int p,
OutputFunction f,
Cost cost)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
backpropagate(double[] error)
Propagates the errors back to a lower layer.
|
void |
computeError(double[] target,
double weight)
Compute the network output error.
|
Cost |
cost()
Returns the cost function of neural network.
|
void |
f(double[] x)
The activation or output function.
|
java.lang.String |
toString() |
computeUpdate, getInputSize, getOutputSize, gradient, linear, mle, mse, output, propagate, rectifier, sigmoid, tanh, update
public OutputLayer(int n, int p, OutputFunction f, Cost cost)
n
- the number of neurons.p
- the number of input variables (not including bias value).f
- the output function.cost
- the cost function.public java.lang.String toString()
toString
in class java.lang.Object
public Cost cost()
public void f(double[] x)
Layer
public void backpropagate(double[] error)
Layer
backpropagate
in class Layer
error
- the gradient vector of lower layer.public void computeError(double[] target, double weight)
target
- the desired output.weight
- a positive weight value associated with the training instance.