Class DSpatialWindowChannel<T extends deepboof.Tensor<T>,​P extends DSpatialPadding2D<T>>

java.lang.Object
deepboof.impl.forward.standard.BaseFunction<T>
deepboof.impl.forward.standard.BaseSpatialWindow<T,​VT>
deepboof.impl.forward.standard.SpatialWindowChannel<T,​P>
deepboof.impl.backward.standard.DSpatialWindowChannel<T,​P>
All Implemented Interfaces:
deepboof.DFunction<T>, deepboof.Function<T>
Direct Known Subclasses:
DSpatialMaxPooling_F64

public abstract class DSpatialWindowChannel<T extends deepboof.Tensor<T>,​P extends DSpatialPadding2D<T>>
extends deepboof.impl.forward.standard.SpatialWindowChannel<T,​P>
implements deepboof.DFunction<T>
Backwards functions for operations which convolve a window across the input spatial tensor and process the image in a BCHW (batch, channel, (row, column)) order, e.g. one channel at a time.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected T dpadding  
    protected boolean learningMode  

    Fields inherited from class deepboof.impl.forward.standard.SpatialWindowChannel

    output

    Fields inherited from class deepboof.impl.forward.standard.BaseSpatialWindow

    C, config, H, HH, Ho, Hp, N, padding, W, Wo, Wp, WW

    Fields inherited from class deepboof.impl.forward.standard.BaseFunction

    miniBatchSize, parameters, shapeInput, shapeOutput, shapeParameters
  • Constructor Summary

    Constructors
    Constructor Description
    DSpatialWindowChannel​(deepboof.forward.ConfigSpatial config, P padding)  
  • Method Summary

    Modifier and Type Method Description
    protected abstract void _backwards​(T input, T dout, T gradientInput, List<T> gradientParameters)  
    void backwards​(T input, T dout, T gradientInput, List<T> gradientParameters)  
    protected abstract void backwardsAt_border​(P padded, int batch, int channel, int padY, int padX, int outY, int outX)
    Applies the backwards local window operation.
    protected abstract void backwardsAt_inner​(T input, int batch, int channel, int inY, int inX, int outY, int outX)
    Applies the backwards local window operation.
    void backwardsChannel​(T input, T gradientInput)
    Convolve window across 'input' spatial tensor and compute its gradient
    void evaluating()  
    Class<T> getTensorType()  
    boolean isLearning()  
    void learning()  

    Methods inherited from class deepboof.impl.forward.standard.SpatialWindowChannel

    forwardAt_border, forwardAt_inner, forwardChannel

    Methods inherited from class deepboof.impl.forward.standard.BaseSpatialWindow

    _initialize, getPadding, innerLowerExtent, innerUpperExtent, isEntirelyBorder

    Methods inherited from class deepboof.impl.forward.standard.BaseFunction

    _forward, _setParameters, forward, getOutputShape, getParameters, getParameterShapes, initialize, setParameters

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface deepboof.Function

    forward, getOutputShape, getParameters, getParameterShapes, initialize, setParameters
  • Field Details

    • learningMode

      protected boolean learningMode
    • dpadding

      protected T extends deepboof.Tensor<T> dpadding
  • Constructor Details

    • DSpatialWindowChannel

      public DSpatialWindowChannel​(deepboof.forward.ConfigSpatial config, P padding)
  • Method Details

    • backwards

      public void backwards​(T input, T dout, T gradientInput, List<T> gradientParameters)
      Specified by:
      backwards in interface deepboof.DFunction<T extends deepboof.Tensor<T>>
    • _backwards

      protected abstract void _backwards​(T input, T dout, T gradientInput, List<T> gradientParameters)
    • backwardsChannel

      public void backwardsChannel​(T input, T gradientInput)
      Convolve window across 'input' spatial tensor and compute its gradient
      Parameters:
      input - Input spatial tensor
      gradientInput - Storage for input's gradient
    • backwardsAt_inner

      protected abstract void backwardsAt_inner​(T input, int batch, int channel, int inY, int inX, int outY, int outX)
      Applies the backwards local window operation. The padded gradient (dpadding) should be computed here. The input gradient will be found later on
      Parameters:
      input - Input spatial tensor
      batch - Index of input in mini-batch that is being processed
      channel - Channel
      inY - y-axis lower extent, in input tensor coordinates
      inX - x-axis lower extent, in input tensor coordinates
      outY - y-axis output coordinate
      outX - x-axis output coordinate
    • backwardsAt_border

      protected abstract void backwardsAt_border​(P padded, int batch, int channel, int padY, int padX, int outY, int outX)
      Applies the backwards local window operation. The padded gradient (dpadding) should be computed here. The input gradient will be found later on
      Parameters:
      padded - Input spatial virtual tensor
      batch - Index of input in mini-batch that is being processed
      channel - Channel
      padY - y-axis lower extent, in padded tensor coordinates
      padX - x-axis lower extent, in padded tensor coordinates
      outY - y-axis output coordinate
      outX - x-axis output coordinate
    • learning

      public void learning()
      Specified by:
      learning in interface deepboof.DFunction<T extends deepboof.Tensor<T>>
    • evaluating

      public void evaluating()
      Specified by:
      evaluating in interface deepboof.DFunction<T extends deepboof.Tensor<T>>
    • isLearning

      public boolean isLearning()
      Specified by:
      isLearning in interface deepboof.DFunction<T extends deepboof.Tensor<T>>
    • getTensorType

      public Class<T> getTensorType()
      Specified by:
      getTensorType in interface deepboof.Function<T extends deepboof.Tensor<T>>