Class ConvolutionLayer.BaseConvBuilder<T extends ConvolutionLayer.BaseConvBuilder<T>>
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.BaseLayer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.ConvolutionLayer.BaseConvBuilder<T>
-
- Direct Known Subclasses:
Convolution1DLayer.Builder
,Convolution3D.Builder
,ConvolutionLayer.Builder
,Deconvolution2D.Builder
,Deconvolution3D.Builder
,DepthwiseConvolution2D.Builder
,SeparableConvolution2D.Builder
- Enclosing class:
- ConvolutionLayer
public abstract static class ConvolutionLayer.BaseConvBuilder<T extends ConvolutionLayer.BaseConvBuilder<T>> extends FeedForwardLayer.Builder<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected int
convolutionDim
protected ConvolutionMode
convolutionMode
Set the convolution mode for the Convolution layer.protected ConvolutionLayer.AlgoMode
cudnnAlgoMode
Defaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.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.protected ConvolutionLayer.BwdDataAlgo
cudnnBwdDataAlgo
protected ConvolutionLayer.BwdFilterAlgo
cudnnBwdFilterAlgo
protected ConvolutionLayer.FwdAlgo
cudnnFwdAlgo
protected int[]
dilation
Kernel dilation.protected boolean
hasBias
If true (default): include bias parameters in the model.int[]
kernelSize
protected int[]
padding
protected int[]
stride
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder
nIn, nOut
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.BaseLayer.Builder
activationFn, biasInit, biasUpdater, gainInit, gradientNormalization, gradientNormalizationThreshold, iupdater, regularization, regularizationBias, weightInitFn, weightNoise
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseConvBuilder()
protected
BaseConvBuilder(int... kernelSize)
protected
BaseConvBuilder(int[] kernelSize, int[] stride)
protected
BaseConvBuilder(int[] kernelSize, int[] stride, int dim)
protected
BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding)
protected
BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int dim)
protected
BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation)
protected
BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation, int dim)
protected
BaseConvBuilder(int dim, int... kernelSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract boolean
allowCausal()
T
convolutionMode(ConvolutionMode convolutionMode)
Set the convolution mode for the Convolution layer.T
cudnnAlgoMode(ConvolutionLayer.AlgoMode cudnnAlgoMode)
Defaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.T
cudnnAllowFallback(boolean allowFallback)
Deprecated.T
cudnnBwdDataMode(ConvolutionLayer.BwdDataAlgo cudnnBwdDataAlgo)
T
cudnnBwdFilterMode(ConvolutionLayer.BwdFilterAlgo cudnnBwdFilterAlgo)
T
cudnnFwdMode(ConvolutionLayer.FwdAlgo cudnnFwdAlgo)
T
dilation(int... dilation)
Kernel dilation.T
hasBias(boolean hasBias)
If true (default): include bias parameters in the model.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.T
kernelSize(int... kernelSize)
T
padding(int... padding)
protected void
setConvolutionMode(ConvolutionMode convolutionMode)
T
stride(int... stride)
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.FeedForwardLayer.Builder
nIn, nIn, nOut, nOut, units
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.BaseLayer.Builder
activation, activation, biasInit, biasUpdater, dist, gainInit, gradientNormalization, gradientNormalizationThreshold, l1, l1Bias, l2, l2Bias, regularization, regularizationBias, updater, updater, weightDecay, weightDecay, weightDecayBias, weightDecayBias, weightInit, weightInit, weightInit, weightNoise
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
build, constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
-
-
-
-
Field Detail
-
convolutionDim
protected int convolutionDim
-
hasBias
protected boolean hasBias
If true (default): include bias parameters in the model. False: no bias.
-
convolutionMode
protected ConvolutionMode convolutionMode
Set the convolution mode for the Convolution layer. SeeConvolutionMode
for more details
-
dilation
protected int[] dilation
Kernel dilation. Default: {1, 1}, which is standard convolutions. Used for implementing dilated convolutions, which are also known as atrous convolutions.For more details, see: Yu and Koltun (2014) and Chen et al. (2014), as well as http://deeplearning.net/software/theano/tutorial/conv_arithmetic.html#dilated-convolutions
-
kernelSize
public int[] kernelSize
-
stride
protected int[] stride
-
padding
protected int[] padding
-
cudnnAlgoMode
protected ConvolutionLayer.AlgoMode cudnnAlgoMode
Defaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.
-
cudnnFwdAlgo
protected ConvolutionLayer.FwdAlgo cudnnFwdAlgo
-
cudnnBwdFilterAlgo
protected ConvolutionLayer.BwdFilterAlgo cudnnBwdFilterAlgo
-
cudnnBwdDataAlgo
protected ConvolutionLayer.BwdDataAlgo cudnnBwdDataAlgo
-
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
-
-
Constructor Detail
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation, int dim)
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation)
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int dim)
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride, int[] padding)
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride, int dim)
-
BaseConvBuilder
protected BaseConvBuilder(int[] kernelSize, int[] stride)
-
BaseConvBuilder
protected BaseConvBuilder(int dim, int... kernelSize)
-
BaseConvBuilder
protected BaseConvBuilder(int... kernelSize)
-
BaseConvBuilder
protected BaseConvBuilder()
-
-
Method Detail
-
allowCausal
protected abstract boolean allowCausal()
-
setConvolutionMode
protected void setConvolutionMode(ConvolutionMode convolutionMode)
-
hasBias
public T hasBias(boolean hasBias)
If true (default): include bias parameters in the model. False: no bias.- Parameters:
hasBias
- If true: include bias parameters in this model
-
convolutionMode
public T convolutionMode(ConvolutionMode convolutionMode)
Set the convolution mode for the Convolution layer. SeeConvolutionMode
for more details- Parameters:
convolutionMode
- Convolution mode for layer
-
dilation
public T dilation(int... dilation)
Kernel dilation. Default: {1, 1}, which is standard convolutions. Used for implementing dilated convolutions, which are also known as atrous convolutions.For more details, see: Yu and Koltun (2014) and Chen et al. (2014), as well as http://deeplearning.net/software/theano/tutorial/conv_arithmetic.html#dilated-convolutions
- Parameters:
dilation
- Dilation for kernel
-
kernelSize
public T kernelSize(int... kernelSize)
-
stride
public T stride(int... stride)
-
padding
public T padding(int... padding)
-
cudnnAlgoMode
public T cudnnAlgoMode(ConvolutionLayer.AlgoMode cudnnAlgoMode)
Defaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.
-
cudnnFwdMode
public T cudnnFwdMode(ConvolutionLayer.FwdAlgo cudnnFwdAlgo)
-
cudnnBwdFilterMode
public T cudnnBwdFilterMode(ConvolutionLayer.BwdFilterAlgo cudnnBwdFilterAlgo)
-
cudnnBwdDataMode
public T cudnnBwdDataMode(ConvolutionLayer.BwdDataAlgo cudnnBwdDataAlgo)
-
cudnnAllowFallback
@Deprecated public T cudnnAllowFallback(boolean allowFallback)
Deprecated.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 true, the built-in (non-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 ConvolutionLayer will be used- Parameters:
allowFallback
- Whether fallback to non-CuDNN implementation should be used
-
-