Interface DSpatialBatchNorm<T extends deepboof.Tensor<T>>

All Superinterfaces:
deepboof.forward.BatchNorm, DBatchNorm<T>, deepboof.DFunction<T>, deepboof.Function<T>
All Known Implementing Classes:
DSpatialBatchNorm_F64

public interface DSpatialBatchNorm<T extends deepboof.Tensor<T>>
extends DBatchNorm<T>

Interface of Spatial Batch Normalization for training networks. Spatial batch norm can be made to be functionally equivalent to regular batch norm by simply reordering each band so that all the pixels inside are treated as one variable. See DFunctionBatchNorm for additional details on training method.

  • Method Summary

    Modifier and Type Method Description
    void forward​(T input, T output)
    Performs batch normalization on spatial data.
    void setParameters​(List<T> parameters)
    There are only parameters when gamma-beta is used.

    Methods inherited from interface deepboof.forward.BatchNorm

    getEPS, hasGammaBeta, setEPS

    Methods inherited from interface deepboof.backward.DBatchNorm

    getMean, getVariance

    Methods inherited from interface deepboof.DFunction

    backwards, evaluating, isLearning, learning

    Methods inherited from interface deepboof.Function

    getOutputShape, getParameters, getParameterShapes, getTensorType, initialize
  • Method Details

    • forward

      void forward​(T input, T output)

      Performs batch normalization on spatial data.

      There is only a parameter tensor if BatchNorm.hasGammaBeta() returns true. If true then gamma, and beta are encoded in a single tensor in an interleaved fashion (gamma, beta).

       Summary Table
       -------------------------------------------------
       Input   shape = (N, C, H,  W)
       Output  shape = (N, C, H,  W)
       Params  shape = (C, 2)
       -------------------------------------------------
       N   = Size of mini-batch
       C   = Number of channels in input image
       H   = Height of input image
       W   = With of input image
       
      Specified by:
      forward in interface deepboof.Function<T extends deepboof.Tensor<T>>
      Parameters:
      input - Input tensor = (N,C,H,W)
      output - Output tensor = (N,C,H,W). Modified.
    • setParameters

      void setParameters​(List<T> parameters)
      There are only parameters when gamma-beta is used. See forward(T, T) for a description parameter encoding.
      Specified by:
      setParameters in interface deepboof.Function<T extends deepboof.Tensor<T>>
      Parameters:
      parameters - Single tensor with shape (C, 2). Not modified.