Package deepboof.impl.forward.standard
Class BaseSpatialWindow<T extends Tensor<T>,P extends SpatialPadding2D<T>>
java.lang.Object
deepboof.impl.forward.standard.BaseFunction<T>
deepboof.impl.forward.standard.BaseSpatialWindow<T,P>
- All Implemented Interfaces:
Function<T>
- Direct Known Subclasses:
SpatialWindowChannel,SpatialWindowImage
public abstract class BaseSpatialWindow<T extends Tensor<T>,P extends SpatialPadding2D<T>> extends BaseFunction<T>
Common class for implementations of
SpatialConvolve2D. Does not assume how kernels span input channels.-
Field Summary
Fields Modifier and Type Field Description protected intCprotected ConfigSpatialconfigConfiguration for convolutionprotected intHprotected intHHprotected intHoprotected intHpprotected intNprotected Ppaddingprotected intWprotected intWoprotected intWpprotected intWWFields inherited from class deepboof.impl.forward.standard.BaseFunction
miniBatchSize, parameters, shapeInput, shapeOutput, shapeParameters -
Constructor Summary
Constructors Constructor Description BaseSpatialWindow(ConfigSpatial config, P padding) -
Method Summary
Modifier and Type Method Description void_initialize()PgetPadding()static intinnerLowerExtent(int period, int padding)The lower extent in output coordinates for regions that are contained entirely inside the original image.static intinnerUpperExtent(int windowLength, int period, int padding, int inputLength)The upper extent int output coordinates for regions that are contained entirely inside the original image.protected booleanisEntirelyBorder(int outR0, int outC0)Do all regions interact with the image border? The provided point is the lower-extent of the output pixel which doesn't interact with input image border.Methods inherited from class deepboof.impl.forward.standard.BaseFunction
_forward, _setParameters, forward, getOutputShape, getParameters, getParameterShapes, initialize, setParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface deepboof.Function
getTensorType
-
Field Details
-
config
Configuration for convolution -
N
protected int N -
C
protected int C -
H
protected int H -
W
protected int W -
HH
protected int HH -
WW
protected int WW -
Ho
protected int Ho -
Wo
protected int Wo -
Hp
protected int Hp -
Wp
protected int Wp -
padding
-
-
Constructor Details
-
BaseSpatialWindow
-
-
Method Details
-
_initialize
public void _initialize()- Specified by:
_initializein classBaseFunction<T extends Tensor<T>>
-
isEntirelyBorder
protected boolean isEntirelyBorder(int outR0, int outC0)Do all regions interact with the image border? The provided point is the lower-extent of the output pixel which doesn't interact with input image border.- Parameters:
outR0- Lower-extent row in output coordinates.outC0- Lower-extent column in output coordinates.
-
innerLowerExtent
public static int innerLowerExtent(int period, int padding)The lower extent in output coordinates for regions that are contained entirely inside the original image. s- Parameters:
period- Sampling period in input tensor pixelspadding- Padding added along lower extent to input tensor- Returns:
- Lower extent in output tensor coordinates, inclusive
-
innerUpperExtent
public static int innerUpperExtent(int windowLength, int period, int padding, int inputLength)The upper extent int output coordinates for regions that are contained entirely inside the original image.- Parameters:
windowLength- Length of sampling window in input tensor pixelperiod- Sampling period in input tensor pixelspadding- Padding added along lower extent to input tensorinputLength- Length of the input tensor- Returns:
- Upper extent in output tensor coordinates, exclusive
-
getPadding
-