Class SoftmaxOutputLayer

All Implemented Interfaces:
Backward, Forward, Layer<TensorBase>, Serializable

public class SoftmaxOutputLayer extends OutputLayer
Output layer with softmax activation function.
Author:
Zoran Sevarac
See Also:
  • Constructor Details

    • SoftmaxOutputLayer

      public SoftmaxOutputLayer(int size)
  • Method Details

    • init

      public void init()
      Description copied from class: AbstractLayer
      This method should implement layer initialization in subclasses, when a layer is added to the network (create weights, outputs, deltas, randomization etc.).
      Overrides:
      init in class OutputLayer
    • initTransientFields

      public void initTransientFields()
      Overrides:
      initTransientFields in class OutputLayer
    • forward

      public void forward()
      Forward pass for the output layer, calculates layer outputs using softmax function.
      Specified by:
      forward in interface Forward
      Specified by:
      forward in interface Layer<TensorBase>
      Overrides:
      forward in class OutputLayer
    • backward

      public void backward()
      Performs backward pass for this layer.
      Specified by:
      backward in interface Backward
      Specified by:
      backward in interface Layer<TensorBase>
      Overrides:
      backward in class OutputLayer
    • applySoftmax

      public void applySoftmax(Tensor1D outputs1D, float maxWs)
      / prva implementacija single threaded ubaci da izvrti batch u for petlji, onda paralelizuj batch
    • applySoftmaxBatch

      public void applySoftmaxBatch(Tensor2D inputs2D, Tensor2D outputs2D)