Class PrimaryCapsules.Builder
- java.lang.Object
-
- org.deeplearning4j.nn.conf.layers.Layer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder<T>
-
- org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder<PrimaryCapsules.Builder>
-
- org.deeplearning4j.nn.conf.layers.PrimaryCapsules.Builder
-
- Enclosing class:
- PrimaryCapsules
public static class PrimaryCapsules.Builder extends SameDiffLayer.Builder<PrimaryCapsules.Builder>
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder
paramWeightInit, weightInit
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder
biasUpdater, regularization, regularizationBias, updater
-
Fields inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
allParamConstraints, biasConstraints, iDropout, layerName, weightConstraints
-
-
Constructor Summary
Constructors Constructor Description Builder(int capsuleDimensions, int channels)
Builder(int capsuleDimensions, int channels, int[] kernelSize)
Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride)
Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding)
Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding, int[] dilation)
Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding, int[] dilation, ConvolutionMode convolutionMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends Layer>
Ebuild()
PrimaryCapsules.Builder
capsuleDimensions(int capsuleDimensions)
Sets the number of dimensions to use in the capsules.PrimaryCapsules.Builder
capsules(int capsules)
Usually inferred automatically.PrimaryCapsules.Builder
channels(int channels)
Sets the number of channels to use in the 2d convolution.PrimaryCapsules.Builder
convolutionMode(ConvolutionMode convolutionMode)
The convolution mode to use in the 2d convolutionPrimaryCapsules.Builder
dilation(int... dilation)
Sets the dilation of the 2d convolutionPrimaryCapsules.Builder
hasBias(boolean hasBias)
PrimaryCapsules.Builder
kernelSize(int... kernelSize)
Sets the kernel size of the 2d convolutionPrimaryCapsules.Builder
nOut(int nOut)
Sets the number of channels to use in the 2d convolution.PrimaryCapsules.Builder
padding(int... padding)
Sets the padding of the 2d convolutionvoid
setDilation(int... dilation)
void
setKernelSize(int... kernelSize)
void
setPadding(int... padding)
void
setStride(int... stride)
PrimaryCapsules.Builder
stride(int... stride)
Sets the stride of the 2d convolutionPrimaryCapsules.Builder
useLeakyReLU(double leak)
Use a LeakyReLU activation on the 2d convolutionPrimaryCapsules.Builder
useReLU()
Use a ReLU activation on the 2d convolutionPrimaryCapsules.Builder
useReLU(boolean useRelu)
Whether to use a ReLU activation on the 2d convolution-
Methods inherited from class org.deeplearning4j.nn.conf.layers.samediff.SameDiffLayer.Builder
weightInit, weightInit
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.samediff.AbstractSameDiffLayer.Builder
biasUpdater, l1, l1Bias, l2, l2Bias, regularization, regularizationBias, updater, weightDecay, weightDecay, weightDecayBias, weightDecayBias
-
Methods inherited from class org.deeplearning4j.nn.conf.layers.Layer.Builder
constrainAllParameters, constrainBias, constrainWeights, dropOut, dropOut, name
-
-
-
-
Constructor Detail
-
Builder
public Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding, int[] dilation, ConvolutionMode convolutionMode)
-
Builder
public Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding, int[] dilation)
-
Builder
public Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride, int[] padding)
-
Builder
public Builder(int capsuleDimensions, int channels, int[] kernelSize, int[] stride)
-
Builder
public Builder(int capsuleDimensions, int channels, int[] kernelSize)
-
Builder
public Builder(int capsuleDimensions, int channels)
-
-
Method Detail
-
setKernelSize
public void setKernelSize(int... kernelSize)
-
setStride
public void setStride(int... stride)
-
setPadding
public void setPadding(int... padding)
-
setDilation
public void setDilation(int... dilation)
-
kernelSize
public PrimaryCapsules.Builder kernelSize(int... kernelSize)
Sets the kernel size of the 2d convolution- Parameters:
kernelSize
-- Returns:
- See Also:
ConvolutionLayer.Builder.kernelSize(int...)
-
stride
public PrimaryCapsules.Builder stride(int... stride)
Sets the stride of the 2d convolution- Parameters:
stride
-- Returns:
- See Also:
ConvolutionLayer.Builder.stride(int...)
-
padding
public PrimaryCapsules.Builder padding(int... padding)
Sets the padding of the 2d convolution- Parameters:
padding
-- Returns:
- See Also:
ConvolutionLayer.Builder.padding(int...)
-
dilation
public PrimaryCapsules.Builder dilation(int... dilation)
Sets the dilation of the 2d convolution- Parameters:
dilation
-- Returns:
- See Also:
ConvolutionLayer.BaseConvBuilder.dilation(int...)
-
channels
public PrimaryCapsules.Builder channels(int channels)
Sets the number of channels to use in the 2d convolution. Note that the actual number of channels is channels * capsuleDimensions Does the same thing as nOut()- Parameters:
channels
-- Returns:
-
nOut
public PrimaryCapsules.Builder nOut(int nOut)
Sets the number of channels to use in the 2d convolution. Note that the actual number of channels is channels * capsuleDimensions Does the same thing as channels()- Parameters:
nOut
-- Returns:
-
capsuleDimensions
public PrimaryCapsules.Builder capsuleDimensions(int capsuleDimensions)
Sets the number of dimensions to use in the capsules.- Parameters:
capsuleDimensions
-- Returns:
-
capsules
public PrimaryCapsules.Builder capsules(int capsules)
Usually inferred automatically.- Parameters:
capsules
-- Returns:
-
hasBias
public PrimaryCapsules.Builder hasBias(boolean hasBias)
-
convolutionMode
public PrimaryCapsules.Builder convolutionMode(ConvolutionMode convolutionMode)
The convolution mode to use in the 2d convolution- Parameters:
convolutionMode
-- Returns:
-
useReLU
public PrimaryCapsules.Builder useReLU(boolean useRelu)
Whether to use a ReLU activation on the 2d convolution- Parameters:
useRelu
-- Returns:
-
useReLU
public PrimaryCapsules.Builder useReLU()
Use a ReLU activation on the 2d convolution- Returns:
-
useLeakyReLU
public PrimaryCapsules.Builder useLeakyReLU(double leak)
Use a LeakyReLU activation on the 2d convolution- Parameters:
leak
- the alpha value for the LeakyReLU activation.- Returns:
-
build
public <E extends Layer> E build()
- Specified by:
build
in classLayer.Builder<PrimaryCapsules.Builder>
-
-