public class OutputLayer extends AbstractLayer
AbstractLayer
,
Layer
,
NeuralNetwork
,
Serialized FormConstructor and Description |
---|
OutputLayer(int width)
Creates an instance of output layer with specified width (number of outputs)
and sigmoid activation function by default.
|
OutputLayer(int width,
ActivationType actType)
Creates an instance of output layer with specified width (number of outputs)
and specified activation function.
|
OutputLayer(String[] outputLabels)
Creates an instance of output layer with specified width (number of outputs)
which corresponds to number of labels and sigmoid activation function by default.
|
OutputLayer(String[] outputLabels,
ActivationType actType) |
Modifier and Type | Method and Description |
---|---|
void |
applyWeightChanges()
Applies weight changes after one learning iteration or batch
|
void |
backward()
This method implements backward pass for the output layer.
|
void |
forward()
This method implements forward pass for the output layer.
|
LossType |
getLossType() |
float[] |
getOutputErrors() |
float |
getSingleOutInput() |
void |
init()
This method should implement layer initialization in subclasses, when a layer is added to
the network (create weights, outputs, deltas, randomization etc.).
|
void |
setLossType(LossType lossType) |
void |
setOutputErrors(float[] outputErrors) |
String |
toString() |
getActivation, getActivationType, getBatchSize, getBiases, getDeltaBiases, getDeltas, getDeltaWeights, getDepth, getGradients, getHeight, getL1Regularization, getL1WeightSum, getL2Regularization, getL2WeightSum, getLearningRate, getMomentum, getNextLayer, getOptimizer, getOptimizerType, getOutputs, getPrevDeltaBiases, getPrevDeltaWeights, getPrevlayer, getWeights, getWidth, initTransientFields, isBatchMode, isTrainable, setBatchMode, setBatchSize, setBiases, setDeltas, setL1Regularization, setL2Regularization, setLearningRate, setMomentum, setNextlayer, setOptimizerType, setOutputs, setPrevDeltaWeights, setPrevLayer, setTrainable, setWeights, setWeights
public OutputLayer(int width)
width
- layer width which represents number of network outputspublic OutputLayer(int width, ActivationType actType)
width
- layer width whic represents number of network outputsactType
- activation functionpublic OutputLayer(String[] outputLabels)
outputLabels
- labels for network's outputspublic OutputLayer(String[] outputLabels, ActivationType actType)
public final void setOutputErrors(float[] outputErrors)
public final float[] getOutputErrors()
public final LossType getLossType()
public void setLossType(LossType lossType)
public void init()
AbstractLayer
init
in class AbstractLayer
public void forward()
forward
in interface Layer
forward
in class AbstractLayer
public void backward()
backward
in interface Layer
backward
in class AbstractLayer
public void applyWeightChanges()
applyWeightChanges
in class AbstractLayer
public float getSingleOutInput()
Copyright © 2022. All rights reserved.