Class SubsamplingLayer.BaseSubsamplingBuilder<T extends SubsamplingLayer.BaseSubsamplingBuilder<T>>
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.SubsamplingLayer.BaseSubsamplingBuilder<T>
-
- Direct Known Subclasses:
Subsampling1DLayer.Builder,SubsamplingLayer.Builder
- Enclosing class:
- SubsamplingLayer
protected abstract static class SubsamplingLayer.BaseSubsamplingBuilder<T extends SubsamplingLayer.BaseSubsamplingBuilder<T>> extends Layer.Builder<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanavgPoolIncludePadInDivisorprotected CNN2DFormatcnn2DFormatConfigure the 2d data formatprotected ConvolutionModeconvolutionModeSet the convolution mode for the Convolution layer.protected booleancudnnAllowFallbackWhen using CuDNN and an error is encountered, should fallback to the non-CuDNN implementatation be allowed? If set to false, an exception in CuDNN will be propagated back to the user.protected doubleepsprotected int[]kernelSizeprotected int[]paddingprotected intpnormprotected PoolingTypepoolingTypeprotected int[]stride-
Fields inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseSubsamplingBuilder(int... kernelSize)protectedBaseSubsamplingBuilder(int[] kernelSize, int[] stride)protectedBaseSubsamplingBuilder(int[] kernelSize, int[] stride, int[] padding)protectedBaseSubsamplingBuilder(PoolingType poolingType)protectedBaseSubsamplingBuilder(PoolingType poolingType, int[] kernelSize)protectedBaseSubsamplingBuilder(PoolingType poolingType, int[] kernelSize, int[] stride, int[] padding)protectedBaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType)protectedBaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize)protectedBaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize, int[] stride)protectedBaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize, int[] stride, int[] padding)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract booleanallowCausal()TavgPoolIncludePadInDivisor(boolean avgPoolIncludePadInDivisor)When doing average pooling, should the padding values be included in the divisor or not?
Not applicable for max and p-norm pooling.
Users should not usually set this - instead, leave it as the default (false).TconvolutionMode(ConvolutionMode convolutionMode)Set the convolution mode for the Convolution layer.TcudnnAllowFallback(boolean allowFallback)Deprecated.TdataFormat(CNN2DFormat cnn2DFormat)Set the data format for the CNN activations - NCHW (channels first) or NHWC (channels last).Teps(double eps)ThelperAllowFallback(boolean allowFallback)When using CuDNN or MKLDNN and an error is encountered, should fallback to the non-helper implementation be allowed? If set to false, an exception in the helper will be propagated back to the user.Tpnorm(int pnorm)TpoolingType(PoolingType poolingType)TpoolingType(SubsamplingLayer.PoolingType poolingType)voidsetConvolutionMode(ConvolutionMode convolutionMode)voidsetEps(double eps)voidsetPnorm(int pnorm)-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
build, constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
-
-
-
-
Field Detail
-
poolingType
protected PoolingType poolingType
-
kernelSize
protected int[] kernelSize
-
stride
protected int[] stride
-
padding
protected int[] padding
-
convolutionMode
protected ConvolutionMode convolutionMode
Set the convolution mode for the Convolution layer. SeeConvolutionModefor more details Convolution mode for layer
-
pnorm
protected int pnorm
-
eps
protected double eps
-
cudnnAllowFallback
protected boolean cudnnAllowFallback
When using CuDNN and an error is encountered, should fallback to the non-CuDNN implementatation be allowed? If set to false, an exception in CuDNN will be propagated back to the user. If false, the built-in (non-CuDNN) implementation for ConvolutionLayer will be used Whether fallback to non-CuDNN implementation should be used
-
avgPoolIncludePadInDivisor
protected boolean avgPoolIncludePadInDivisor
-
cnn2DFormat
protected CNN2DFormat cnn2DFormat
Configure the 2d data format
-
-
Constructor Detail
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize, int[] stride)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType, int[] kernelSize, int[] stride, int[] padding)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(PoolingType poolingType, int[] kernelSize)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(PoolingType poolingType, int[] kernelSize, int[] stride, int[] padding)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(int[] kernelSize, int[] stride, int[] padding)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(int[] kernelSize, int[] stride)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(int... kernelSize)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(SubsamplingLayer.PoolingType poolingType)
-
BaseSubsamplingBuilder
protected BaseSubsamplingBuilder(PoolingType poolingType)
-
-
Method Detail
-
setPnorm
public void setPnorm(int pnorm)
-
setEps
public void setEps(double eps)
-
allowCausal
protected abstract boolean allowCausal()
-
setConvolutionMode
public void setConvolutionMode(ConvolutionMode convolutionMode)
-
dataFormat
public T dataFormat(CNN2DFormat cnn2DFormat)
Set the data format for the CNN activations - NCHW (channels first) or NHWC (channels last). SeeCNN2DFormatfor more details.
Default: NCHW- Parameters:
cnn2DFormat- Format for activations (in and out)
-
convolutionMode
public T convolutionMode(ConvolutionMode convolutionMode)
Set the convolution mode for the Convolution layer. SeeConvolutionModefor more details- Parameters:
convolutionMode- Convolution mode for layer
-
poolingType
public T poolingType(SubsamplingLayer.PoolingType poolingType)
-
poolingType
public T poolingType(PoolingType poolingType)
-
pnorm
public T pnorm(int pnorm)
-
eps
public T eps(double eps)
-
cudnnAllowFallback
@Deprecated public T cudnnAllowFallback(boolean allowFallback)
Deprecated.When using CuDNN or MKLDNN and an error is encountered, should fallback to the non-helper implementation be allowed? If set to false, an exception in the helper will be propagated back to the user. If true, the built-in (non-MKL/CuDNN) implementation for ConvolutionLayer will be used- Parameters:
allowFallback- Whether fallback to non-CuDNN implementation should be used
-
helperAllowFallback
public T helperAllowFallback(boolean allowFallback)
When using CuDNN or MKLDNN and an error is encountered, should fallback to the non-helper implementation be allowed? If set to false, an exception in the helper will be propagated back to the user. If true, the built-in (non-MKL/CuDNN) implementation for SubsamplingLayer will be used- Parameters:
allowFallback- Whether fallback to non-CuDNN implementation should be used
-
avgPoolIncludePadInDivisor
public T avgPoolIncludePadInDivisor(boolean avgPoolIncludePadInDivisor)
When doing average pooling, should the padding values be included in the divisor or not?
Not applicable for max and p-norm pooling.
Users should not usually set this - instead, leave it as the default (false). It is included mainly for backward compatibility of older models
Consider the following 2x2 segment along the right side of the image:
[A, P] [B, P]
Where A and B are actual values, and P is padding (0).
With avgPoolIncludePadInDivisor = true, we have: out = (A+B+0+0)/4
With avgPoolIncludePadInDivisor = false, we have: out = (A+B+0+0)/2
Earlier versions of DL4J originally included padding in the count, newer versions exclude it.- Parameters:
avgPoolIncludePadInDivisor- Whether the divisor should include or exclude padding for average pooling
-
-