Package deepboof.impl.backward.standard
Class DSpatialConvolve2D_F64
java.lang.Object
deepboof.impl.forward.standard.BaseFunction<T>
deepboof.impl.forward.standard.BaseSpatialWindow<T,P>
deepboof.impl.forward.standard.SpatialWindowImage<T,P>
deepboof.impl.backward.standard.DSpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>
deepboof.impl.backward.standard.DSpatialConvolve2D_F64
- All Implemented Interfaces:
DSpatialConvolve2D<deepboof.tensors.Tensor_F64>,deepboof.DFunction<deepboof.tensors.Tensor_F64>,deepboof.forward.SpatialConvolve2D<deepboof.tensors.Tensor_F64>,deepboof.Function<deepboof.tensors.Tensor_F64>
public class DSpatialConvolve2D_F64 extends DSpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64> implements DSpatialConvolve2D<deepboof.tensors.Tensor_F64>
Implementation of
DSpatialConvolve2D for Tensor_F64.
Local caches of the spatial tensor are used to reduce cache misses. The cache will contain a region across all of the tensor's channels that encompasses the region that a single convolution would interact with. In the backwards pass the local cache is written back into the derivative padded input tensor.
-
Field Summary
Fields Modifier and Type Field Description protected deepboof.tensors.Tensor_F64biasprotected double[]cachedDPaddingprotected double[]cachedPaddedprotected deepboof.tensors.Tensor_F64dBiasprotected deepboof.tensors.Tensor_F64doutprotected deepboof.tensors.Tensor_F64dWeightsprotected intFprotected deepboof.tensors.Tensor_F64weightsFields inherited from class deepboof.impl.backward.standard.DSpatialWindowImage
dpadding, learningModeFields inherited from class deepboof.impl.forward.standard.SpatialWindowImage
outputFields inherited from class deepboof.impl.forward.standard.BaseSpatialWindow
C, config, H, HH, Ho, Hp, N, padding, W, Wo, Wp, WWFields inherited from class deepboof.impl.forward.standard.BaseFunction
miniBatchSize, parameters, shapeInput, shapeOutput, shapeParameters -
Constructor Summary
Constructors Constructor Description DSpatialConvolve2D_F64(deepboof.forward.ConfigConvolve2D config, DSpatialPadding2D_F64 padding) -
Method Summary
Modifier and Type Method Description protected void_backwards(deepboof.tensors.Tensor_F64 input, deepboof.tensors.Tensor_F64 dout, deepboof.tensors.Tensor_F64 gradientInput, List<deepboof.tensors.Tensor_F64> gradientParameters)void_forward(deepboof.tensors.Tensor_F64 input, deepboof.tensors.Tensor_F64 output)void_initialize()void_setParameters(List<deepboof.tensors.Tensor_F64> parameters)protected voidbackwardsAt_border(DSpatialPadding2D_F64 padded, int batch, int padY, int padX, int outY, int outX)Applies the operations at the specified window and stores the results at the specified output coordinate.protected voidbackwardsAt_inner(deepboof.tensors.Tensor_F64 input, int batch, int inY, int inX, int outY, int outX)Applies the operations at the specified window and stores the results at the specified output coordinate.protected voidforwardAt_border(DSpatialPadding2D_F64 padded, int batch, int padY, int padX, int outY, int outX)protected voidforwardAt_inner(deepboof.tensors.Tensor_F64 input, int batch, int inY, int inX, int outY, int outX)deepboof.forward.ConfigConvolve2DgetConfiguration()Methods inherited from class deepboof.impl.backward.standard.DSpatialWindowImage
backwards, backwardsImage, evaluating, getTensorType, isLearning, learningMethods inherited from class deepboof.impl.forward.standard.SpatialWindowImage
forwardImageMethods inherited from class deepboof.impl.forward.standard.BaseSpatialWindow
getPadding, innerLowerExtent, innerUpperExtent, isEntirelyBorderMethods inherited from class deepboof.impl.forward.standard.BaseFunction
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.DFunction
backwards, evaluating, isLearning, learningMethods inherited from interface deepboof.Function
getOutputShape, getParameters, getParameterShapes, getTensorType, initializeMethods inherited from interface deepboof.forward.SpatialConvolve2D
forward, getPadding, setParameters
-
Field Details
-
F
protected int F -
weights
protected deepboof.tensors.Tensor_F64 weights -
bias
protected deepboof.tensors.Tensor_F64 bias -
dWeights
protected deepboof.tensors.Tensor_F64 dWeights -
dBias
protected deepboof.tensors.Tensor_F64 dBias -
dout
protected deepboof.tensors.Tensor_F64 dout -
cachedPadded
protected double[] cachedPadded -
cachedDPadding
protected double[] cachedDPadding
-
-
Constructor Details
-
DSpatialConvolve2D_F64
public DSpatialConvolve2D_F64(deepboof.forward.ConfigConvolve2D config, DSpatialPadding2D_F64 padding)
-
-
Method Details
-
_setParameters
- Specified by:
_setParametersin classdeepboof.impl.forward.standard.BaseFunction<deepboof.tensors.Tensor_F64>
-
_initialize
public void _initialize()- Overrides:
_initializein classdeepboof.impl.forward.standard.BaseSpatialWindow<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>
-
_forward
public void _forward(deepboof.tensors.Tensor_F64 input, deepboof.tensors.Tensor_F64 output)- Specified by:
_forwardin classdeepboof.impl.forward.standard.BaseFunction<deepboof.tensors.Tensor_F64>
-
forwardAt_inner
protected void forwardAt_inner(deepboof.tensors.Tensor_F64 input, int batch, int inY, int inX, int outY, int outX)- Specified by:
forwardAt_innerin classdeepboof.impl.forward.standard.SpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>
-
forwardAt_border
protected void forwardAt_border(DSpatialPadding2D_F64 padded, int batch, int padY, int padX, int outY, int outX)- Specified by:
forwardAt_borderin classdeepboof.impl.forward.standard.SpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>
-
_backwards
protected void _backwards(deepboof.tensors.Tensor_F64 input, deepboof.tensors.Tensor_F64 dout, deepboof.tensors.Tensor_F64 gradientInput, List<deepboof.tensors.Tensor_F64> gradientParameters)- Specified by:
_backwardsin classDSpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>
-
backwardsAt_inner
protected void backwardsAt_inner(deepboof.tensors.Tensor_F64 input, int batch, int inY, int inX, int outY, int outX)Description copied from class:DSpatialWindowImageApplies the operations at the specified window and stores the results at the specified output coordinate.- Specified by:
backwardsAt_innerin classDSpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>- Parameters:
input- Input spatial tensorbatch- Index of input in mini-batch that is being processedinY- y-axis lower extent, in input coordinatesinX- x-axis lower extent, in input coordinatesoutY- y-axis output coordinatesoutX- x-axis output coordinates
-
backwardsAt_border
protected void backwardsAt_border(DSpatialPadding2D_F64 padded, int batch, int padY, int padX, int outY, int outX)Description copied from class:DSpatialWindowImageApplies the operations at the specified window and stores the results at the specified output coordinate. For virtual tensor- Specified by:
backwardsAt_borderin classDSpatialWindowImage<deepboof.tensors.Tensor_F64,DSpatialPadding2D_F64>- Parameters:
padded- Padded input spatial virtual tensorbatch- Index of input in mini-batch that is being processedpadY- y-axis lower extent, inclusive. Padded coordinatespadX- x-axis lower extent, inclusive. Padded coordinatesoutY- y-axis output coordinatesoutX- x-axis output coordinates
-
getConfiguration
public deepboof.forward.ConfigConvolve2D getConfiguration()- Specified by:
getConfigurationin interfacedeepboof.forward.SpatialConvolve2D<deepboof.tensors.Tensor_F64>
-