Interface SpatialPooling<T extends Tensor>

All Superinterfaces:
Function<T>
All Known Subinterfaces:
SpatialAveragePooling<T>, SpatialMaxPooling<T>
All Known Implementing Classes:
SpatialAveragePooling_F32, SpatialAveragePooling_F64, SpatialMaxPooling_F32, SpatialMaxPooling_F64

public interface SpatialPooling<T extends Tensor>
extends Function<T>
Spatial pooling down samples the input spatial tensors by finding a representative value inside each pooling region. The intent is to reduce the number of variables while maintaining much of the original information. Pooling is specified by the region's size (poolWidth, poolHeight) and the sampling period (periodX, periodY), and padding parameters. Processing Steps:
  1. Apply spatial padding
  2. Apply spatial pooling to padded image

Notes

  • The first region has it's lower extent at the spatial region's lower extent.
  • Sampling is done in a row-major ordering, e.g. columns then rows
  • If a region extends outside the image plus padding it's ignore
See Also:
SpatialPadding2D, SpatialMaxPooling, SpatialAveragePooling
  • Method Details

    • forward

      void forward​(T input, T output)
      Processes a spatial tensor.
       N  = number of mini-batch images
       C  = number of channels in each image
       H  = height of input image
       W  = width of input image
       Hp = height of input image + padding
       Wp = width of input image + padding
      
       Shape of output spacial tensor:
      
       H' = 1 + (Hp - poolHeight) / periodY
       W' = 1 + (Wp - poolWidth ) / periodX
       
      Specified by:
      forward in interface Function<T extends Tensor>
      Parameters:
      input - Input spacial tensor = (N, C, H, W)
      output - Output spatial tensor = (N, C, H', W')
    • setParameters

      void setParameters​(java.util.List<T> parameters)
      Can skip. No parameters required.
      Specified by:
      setParameters in interface Function<T extends Tensor>
      Parameters:
      parameters - No parameters required
    • getConfiguration

      ConfigSpatial getConfiguration()
      Returns pooling configuration
      Returns:
      configuration