Package ai.djl.nn.convolutional
Class Deconvolution.DeconvolutionBuilder<T extends Deconvolution.DeconvolutionBuilder>
java.lang.Object
ai.djl.nn.convolutional.Deconvolution.DeconvolutionBuilder<T>
- Type Parameters:
T
- the type ofDeconvolution
block to build
- Direct Known Subclasses:
Conv1dTranspose.Builder
,Conv2dTranspose.Builder
- Enclosing class:
- Deconvolution
public abstract static class Deconvolution.DeconvolutionBuilder<T extends Deconvolution.DeconvolutionBuilder>
extends Object
A builder that can build any
Deconvolution
block.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionoptBias
(boolean includeBias) Sets the optional parameter of whether to include a bias vector.optDilation
(Shape dilate) Sets the dilation along each dimension.optGroups
(int groups) Sets the number of group partitions.optOutPadding
(Shape outPadding) Sets the out_padding along each dimension.optPadding
(Shape padding) Sets the padding along each dimension.Sets the stride of the deconvolution.protected abstract T
self()
setFilters
(int filters) Sets the Required number of filters.setKernelShape
(Shape kernelShape) Sets the shape of the kernel.protected void
validate()
Validates that the required arguments are set.
-
Field Details
-
kernelShape
-
stride
-
padding
-
outPadding
-
dilation
-
filters
protected int filters -
groups
protected int groups -
includeBias
protected boolean includeBias
-
-
Constructor Details
-
DeconvolutionBuilder
public DeconvolutionBuilder()
-
-
Method Details
-
setKernelShape
Sets the shape of the kernel.- Parameters:
kernelShape
- the shape of the kernel- Returns:
- this Builder
-
optStride
Sets the stride of the deconvolution. Defaults to 1 in each dimension.- Parameters:
stride
- the shape of the stride- Returns:
- this Builder
-
optPadding
Sets the padding along each dimension. Defaults to 0 along each dimension.- Parameters:
padding
- the shape of padding along each dimension- Returns:
- this Builder
-
optOutPadding
Sets the out_padding along each dimension. Defaults to 0 along each dimension.- Parameters:
outPadding
- the shape of out_padding along each dimension- Returns:
- this Builder
-
optDilation
Sets the dilation along each dimension. Defaults to 1 along each dimension.- Parameters:
dilate
- the shape of dilation along each dimension- Returns:
- this Builder
-
setFilters
Sets the Required number of filters.- Parameters:
filters
- the number of deconvolution filters(channels)- Returns:
- this Builder
-
optGroups
Sets the number of group partitions.- Parameters:
groups
- the number of group partitions- Returns:
- this Builder
-
optBias
Sets the optional parameter of whether to include a bias vector. Includes bias by default.- Parameters:
includeBias
- whether to use a bias vector parameter- Returns:
- this Builder
-
validate
protected void validate()Validates that the required arguments are set.- Throws:
IllegalArgumentException
- if the required arguments are not set
-
self
-