Package deepboof.impl.forward.standard
Class BaseSpatialPadding2D<T extends Tensor<T>>
java.lang.Object
deepboof.BaseTensor
deepboof.impl.forward.standard.BaseSpatialPadding2D<T>
- All Implemented Interfaces:
SpatialPadding2D<T>,ITensor,VTensor
- Direct Known Subclasses:
SpatialPadding2D_F32,SpatialPadding2D_F64
public abstract class BaseSpatialPadding2D<T extends Tensor<T>>
extends BaseTensor
implements SpatialPadding2D<T>
Abstract class fo all virtual 2D spatial padding implementation. Virtual padding contains a reference
to the original input tensor which is going to be padded and on the fly will generate the values for
elements which are not explicitly contained in the input tensor. This can reduce memory consumption and is
more simplistic to implement for more complex padding methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected ConfigPaddingprotected Tprotected intprotected intFields inherited from class deepboof.BaseTensor
shape -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Tensor<T>>
voidcheckBackwardsShapeChannel(Tensor<T> padded, Tensor<T> original) Sanity checks the input for backwards images<T extends Tensor<T>>
voidcheckBackwardsShapeImage(Tensor<T> padded, Tensor<T> original) Sanity checks the input for backwards imagesintReturns the lower-extent padding along the tensor's columns.intReturns the upper-extent padding along the tensor's columns.intReturns the lower-extent padding along the tensor's rows.intReturns the upper-extent padding along the tensor's rows.voidSpatial tensor that padding is being added aroundint[]shapeGivenInput(int... inputShape) Returns what the tensor's shape will be when given can input tensor with the spcified shape.Methods inherited from class deepboof.BaseTensor
createCoor, getDimension, getShape, isShape, lengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface deepboof.ITensor
createCoor, getDataType, getDimension, getShape, isShape, lengthMethods inherited from interface deepboof.forward.SpatialPadding2D
getClippingOffsetCol, getClippingOffsetRow, getTensorType, isClipped
-
Field Details
-
config
-
input
-
ROW0
protected int ROW0 -
ROW1
protected int ROW1 -
COL0
protected int COL0 -
COL1
protected int COL1
-
-
Constructor Details
-
BaseSpatialPadding2D
-
-
Method Details
-
setInput
Spatial tensor that padding is being added around- Specified by:
setInputin interfaceSpatialPadding2D<T extends Tensor<T>>- Parameters:
input- The input tensor
-
getPaddingRow0
public int getPaddingRow0()Returns the lower-extent padding along the tensor's rows.- Specified by:
getPaddingRow0in interfaceSpatialPadding2D<T extends Tensor<T>>- Returns:
- padding
-
getPaddingCol0
public int getPaddingCol0()Returns the lower-extent padding along the tensor's columns.- Specified by:
getPaddingCol0in interfaceSpatialPadding2D<T extends Tensor<T>>- Returns:
- padding
-
getPaddingRow1
public int getPaddingRow1()Returns the upper-extent padding along the tensor's rows.- Specified by:
getPaddingRow1in interfaceSpatialPadding2D<T extends Tensor<T>>- Returns:
- padding
-
getPaddingCol1
public int getPaddingCol1()Returns the upper-extent padding along the tensor's columns.- Specified by:
getPaddingCol1in interfaceSpatialPadding2D<T extends Tensor<T>>- Returns:
- padding
-
shapeGivenInput
public int[] shapeGivenInput(int... inputShape) Returns what the tensor's shape will be when given can input tensor with the spcified shape.- Specified by:
shapeGivenInputin interfaceSpatialPadding2D<T extends Tensor<T>>- Parameters:
inputShape- Input spatial tensor. 3-DOF with no mini-batch or 4-DOF with mini-batch- Returns:
- Tensor's shape
-
checkBackwardsShapeChannel
Sanity checks the input for backwards images- Parameters:
padded- Input padded single channel image from forward layeroriginal- Output backwards spatial tensor
-
checkBackwardsShapeImage
Sanity checks the input for backwards images- Parameters:
padded- Input padded image from forward layeroriginal- Output backwards spatial tensor
-