Interface SpatialBatchNorm<T extends Tensor<T>>

All Superinterfaces:
BatchNorm, Function<T>
All Known Implementing Classes:
SpatialBatchNorm_F32, SpatialBatchNorm_F64

public interface SpatialBatchNorm<T extends Tensor<T>>
extends Function<T>, BatchNorm

Spatial Batch Normalization seeks to maintain the convolutional property, "that different elements of the same feature map, at different locations, are normalized in the same way." [1] Thus the input tensor (N,C,H,W) is "reshaped" such that it is (N*H*W,C) and it's treated like a mini-batch with N*H*W elements.

See BatchNorm for a general discussion of Batch Normalization

  • Method Details

    • forward

      void forward​(T input, T output)
      Performs batch norm on spatial data.
       Summary Table
       -------------------------------------------------
       Input   shape = (N, C, H,  W)
       Output  shape = (N, C, H,  W)
       Params  shape = (C, M)
       -------------------------------------------------
       N   = Size of mini-batch
       C   = Number of channels in input image
       H   = Height of input image
       W   = With of input image
       M   = Number of parameters.  2 or 4 if gamma-beta is being used.
             in order of: mean, stdev  OR mean, stdev, gamma, beta
       
      Specified by:
      forward in interface Function<T extends Tensor<T>>
      Parameters:
      input - Input tensor = (N,C,H,W)
      output - Output tensor = (N,C,H,W). Modified.
    • setParameters

      void setParameters​(java.util.List<T> parameters)
      See forward(T, T) for a description of parameters.
      Specified by:
      setParameters in interface Function<T extends Tensor<T>>
      Parameters:
      parameters - Variable tensor. (C, M), where M is 2 or 4. Not modified.