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

All Superinterfaces:
deepboof.ITensor, deepboof.forward.SpatialPadding2D<T>, deepboof.VTensor
All Known Subinterfaces:
DSpatialPadding2D_F64
All Known Implementing Classes:
DClippedPadding2D_F64, DConstantPadding2D_F64

public interface DSpatialPadding2D<T extends deepboof.Tensor<T>>
extends deepboof.forward.SpatialPadding2D<T>
Interface for computing the gradient of a padded spatial tensor. Spatial tensors have the shape of (N, C, H, W) where N is the number of mini-batches, C channels, H height and W width.
  • Method Summary

    Modifier and Type Method Description
    void backwardsChannel​(T gradientPadded, int batch, int channel, T gradientInput)
    Compute the gradient of the input image from the gradient of the padded image for a specific mini-batch and channel of the input tensor.
    void backwardsImage​(T gradientPadded, int batch, T gradientInput)
    Compute the gradient of the input image from the gradient of the padded image for a specific mini-batch and channel of the input tensor.

    Methods inherited from interface deepboof.ITensor

    createCoor, getDataType, getDimension, getShape, isShape, length

    Methods inherited from interface deepboof.forward.SpatialPadding2D

    getClippingOffsetCol, getClippingOffsetRow, getPaddingCol0, getPaddingCol1, getPaddingRow0, getPaddingRow1, getTensorType, isClipped, setInput, shapeGivenInput
  • Method Details

    • backwardsChannel

      void backwardsChannel​(T gradientPadded, int batch, int channel, T gradientInput)

      Compute the gradient of the input image from the gradient of the padded image for a specific mini-batch and channel of the input tensor.

      Parameters:
      gradientPadded - (Input) Gradient of padded image at specific mini-batch and channel. (H, W)
      batch - (Input) mini-batch.
      channel - (Input) Channel.
      gradientInput - (Output) Output 4D spatial tensor. Only elements used to compute the channel are modified. (N, C, H, W)
    • backwardsImage

      void backwardsImage​(T gradientPadded, int batch, T gradientInput)

      Compute the gradient of the input image from the gradient of the padded image for a specific mini-batch and channel of the input tensor.

      Parameters:
      gradientPadded - (Input) Gradient of padded image at specific mini-batch. (C, H, W)
      batch - (Input) mini-batch.
      gradientInput - (Output) Output 4D spatial tensor. Only elements used to compute the image are modified. (N, C, H, W)