Class SoftmaxOutputLayer
java.lang.Object
deepnetts.net.layers.AbstractLayer<TensorBase, TensorBase, Tensor2D>
deepnetts.net.layers.OutputLayer
deepnetts.net.layers.SoftmaxOutputLayer
- All Implemented Interfaces:
Backward, Forward, Layer<TensorBase>, Serializable
Output layer with softmax activation function.
- Author:
- Zoran Sevarac
- See Also:
-
Field Summary
Fields inherited from class OutputLayer
backwardTasks, forwardTasks, labels, lossType, multithreaded, outputErrorsFields inherited from class AbstractLayer
activation, activationType, backwardImpl, batchMode, batchSize, biases, cudaHandles, deltaBiases, deltas, deltaWeights, depth, forwardImpl, gradients, height, inputs, learningRate, mode, momentum, networkType, nextLayer, numThreads, optimizer, optimizerType, outputs, prevDeltaBiases, prevDeltaWeights, prevLayer, randomWeightsType, regL1, regL2, threadPool, trainable, weights, width -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplySoftmax(Tensor1D outputs1D, float maxWs) / prva implementacija single threaded ubaci da izvrti batch u for petlji, onda paralelizuj batchvoidapplySoftmaxBatch(Tensor2D inputs2D, Tensor2D outputs2D) voidbackward()Performs backward pass for this layer.voidforward()Forward pass for the output layer, calculates layer outputs using softmax function.voidinit()This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).voidMethods inherited from class OutputLayer
applyWeightChanges, getLossType, getOutputErrors, getSingleOutInput, setLossType, setOutputErrors, toStringMethods inherited from class AbstractLayer
getActivation, getActivationType, getBackwardAcc, getBatchSize, getBiases, getDeltaBiases, getDeltas, getDeltaWeights, getDepth, getForwardAcc, getGradients, getHeight, getL1Regularization, getL1WeightSum, getL2Regularization, getL2WeightSum, getLearningRate, getMode, getMomentum, getNetworkType, getNextLayer, getNumThreads, getOptimizer, getOptimizerType, getOutputs, getPrevDeltaBiases, getPrevDeltaWeights, getPrevlayer, getWeights, getWidth, isBatchMode, isTrainable, setActivationType, setBatchMode, setBatchSize, setBiases, setCudaHandles, setDeltas, setL1Regularization, setL2Regularization, setLearningRate, setMode, setMomentum, setNetworkType, setNextlayer, setOptimizerType, setOutputs, setPrevDeltaWeights, setPrevLayer, setThreadPool, setTrainable, setWeights, setWeights
-
Constructor Details
-
SoftmaxOutputLayer
public SoftmaxOutputLayer(int size)
-
-
Method Details
-
init
public void init()Description copied from class:AbstractLayerThis method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).- Overrides:
initin classOutputLayer
-
initTransientFields
public void initTransientFields()- Overrides:
initTransientFieldsin classOutputLayer
-
forward
public void forward()Forward pass for the output layer, calculates layer outputs using softmax function.- Specified by:
forwardin interfaceForward- Specified by:
forwardin interfaceLayer<TensorBase>- Overrides:
forwardin classOutputLayer
-
backward
public void backward()Performs backward pass for this layer.- Specified by:
backwardin interfaceBackward- Specified by:
backwardin interfaceLayer<TensorBase>- Overrides:
backwardin classOutputLayer
-
applySoftmax
/ prva implementacija single threaded ubaci da izvrti batch u for petlji, onda paralelizuj batch -
applySoftmaxBatch
-