Conv3DTransposeLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
3D transposed convolution (“up-convolution”) for volumetric data — the learnable
upsampling primitive the 3D U-Net decoder is built from (Cicek et al. 2016).
Operates on rank-5 input [B, C_in, D, H, W] and produces
[B, C_out, D*stride, H*stride, W*stride].
Inheritance: LayerBase<T> → Conv3DTransposeLayer<T>
Implements: IShapeContract
For Beginners
An ordinary convolution shrinks a volume; this one grows it. The decoder half of a U-Net needs to get back to full resolution, and doing that with a LEARNED operation rather than a fixed rule lets the network decide how to fill in the detail. Cicek et al. also halve the channel count here, which is why the U-Net decoder is cheap enough to run at all.
How It Works
How it is implemented. The engine exposes Conv3D but no ConvTranspose3D,
and IEngine lives in the separate AiDotNet.Tensors package. For the case this layer
supports – stride == kernelSize, which is the 2x2x2/stride-2 up-convolution the paper
specifies – a transposed convolution is EXACTLY equivalent to a 1x1x1 convolution producing
C_out * stride^3 channels followed by a depth-to-space rearrangement. That is the
sub-pixel convolution identity of Shi et al. (2016): with stride equal to kernel size the
output blocks are disjoint, so every output voxel is one input voxel times one kernel weight,
and grouping those weights by their position within the block turns the whole operation into a
channel projection plus a reshuffle. It is not an approximation.
The rearrangement is done as three rank-6 reshape/permute stages, one per spatial axis, rather than a single rank-8 permute, because a rank-8 tensor is the more likely thing for a backend to reject. Every operation used is an existing engine op, so the tape autodiff backward comes for free and there is no hand-written gradient to get wrong.
Strides other than kernelSize are REJECTED rather than approximated. The sub-pixel
identity does not hold when the output blocks overlap, and silently computing something that
is not a transposed convolution would be worse than refusing.
Constructors
| Constructor | Summary |
|---|---|
Conv3DTransposeLayer(int outputChannels, int kernelSize, int stride, IActivationFunction<T> activation, IInitializationStrategy<T> initializationStrategy) |
Creates an up-convolution that grows each spatial axis by stride. |
Properties
| Property | Summary |
|---|---|
bool HasUninitializedParameters { get; } |
|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
Dictionary<string, string> GetParameterRoles() |
Returns parameter roles for per-role optimizer configuration (e.g., weight decay exemption for biases). |
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
Declares the output shape relation: channels are fixed, and every spatial axis is scaled by the stride. |
IReadOnlyList<Tensor<T>> GetTrainableParameters() |
Returns all trainable parameter tensors marked with [TrainableParameter]. |
void ResetState() |
|
void SetTrainableParameters(IReadOnlyList<Tensor<T>> parameters) |
Replaces trainable parameter tensors (e.g., with ParameterBuffer views). |
void ZeroGrad() |
Clears all gradient fields discovered by convention ({paramName}Gradient). |