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 intconvolutionDimprotected ConvolutionModeconvolutionModeSet the convolution mode for the Convolution layer.protected ConvolutionLayer.AlgoModecudnnAlgoModeDefaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.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 ConvolutionLayer.BwdDataAlgocudnnBwdDataAlgoprotected ConvolutionLayer.BwdFilterAlgocudnnBwdFilterAlgoprotected ConvolutionLayer.FwdAlgocudnnFwdAlgoprotected int[]dilationKernel dilation.protected booleanhasBiasIf true (default): include bias parameters in the model.int[]kernelSizeprotected int[]paddingprotected 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 protectedBaseConvBuilder()protectedBaseConvBuilder(int... kernelSize)protectedBaseConvBuilder(int[] kernelSize, int[] stride)protectedBaseConvBuilder(int[] kernelSize, int[] stride, int dim)protectedBaseConvBuilder(int[] kernelSize, int[] stride, int[] padding)protectedBaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int dim)protectedBaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation)protectedBaseConvBuilder(int[] kernelSize, int[] stride, int[] padding, int[] dilation, int dim)protectedBaseConvBuilder(int dim, int... kernelSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract booleanallowCausal()TconvolutionMode(ConvolutionMode convolutionMode)Set the convolution mode for the Convolution layer.TcudnnAlgoMode(ConvolutionLayer.AlgoMode cudnnAlgoMode)Defaults to "PREFER_FASTEST", but "NO_WORKSPACE" uses less memory.TcudnnAllowFallback(boolean allowFallback)Deprecated.TcudnnBwdDataMode(ConvolutionLayer.BwdDataAlgo cudnnBwdDataAlgo)TcudnnBwdFilterMode(ConvolutionLayer.BwdFilterAlgo cudnnBwdFilterAlgo)TcudnnFwdMode(ConvolutionLayer.FwdAlgo cudnnFwdAlgo)Tdilation(int... dilation)Kernel dilation.ThasBias(boolean hasBias)If true (default): include bias parameters in the model.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.TkernelSize(int... kernelSize)Tpadding(int... padding)protected voidsetConvolutionMode(ConvolutionMode convolutionMode)Tstride(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. SeeConvolutionModefor 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. SeeConvolutionModefor 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
-
-