Class MaxPoolingLayer

  • All Implemented Interfaces:
    Layer, java.io.Serializable

    public final class MaxPoolingLayer
    extends AbstractLayer
    This layer performs max pooling operation in convolutional neural network, which scales down output from previous layer by taking max outputs from small predefined filter areas.
    Author:
    Zoran Sevarac
    See Also:
    ConvolutionalNetwork, Serialized Form
    • Constructor Detail

      • MaxPoolingLayer

        public MaxPoolingLayer​(int filterWidth,
                               int filterHeight,
                               int stride)
        Creates a new max pooling layer with specified filter dimensions and stride.
        Parameters:
        filterWidth - width of the filter square
        filterHeight - height of the filter square
        stride - filter step
    • Method Detail

      • init

        public final void init()
        Description copied from class: AbstractLayer
        This method should implement layer initialization when layer is added to network (create weights, outputs, deltas, randomization etc.)
        Specified by:
        init in class AbstractLayer
      • forward

        public void forward()
        Max pooling forward pass outputs the max value for each filter position.
        Specified by:
        forward in interface Layer
        Specified by:
        forward in class AbstractLayer
      • backward

        public void backward()
        backward pass for a max(x, y) operation has a simple interpretation as only routing the gradient to the input that had the highest value in the forward pass. Hence, during the forward pass of a pooling layer it is common to keep track of the index of the max activation (sometimes also called the switches) so that gradient routing is efficient during backpropagation. backward error pass samo kroz index oji je prosao forward pass
        Specified by:
        backward in interface Layer
        Specified by:
        backward in class AbstractLayer
      • applyWeightChanges

        public void applyWeightChanges()
        Does nothing for pooling layer since it does not have weights It just propagates deltas from next layer to previous through connections that had max activation in forward pass
        Specified by:
        applyWeightChanges in class AbstractLayer
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object