TorchLean NN: Convolution and Pooling Layers #
N-D convolution layer for a channels-first tensor (batch, inputChannels, spatial...).
Parameters:
- weight:
(outputChannels × inputChannels × kernelSize[0] × ... × kernelSize[rank-1]), - bias:
(outputChannels).
The output spatial shape is computed from (stride, padding, kernelSize).
PyTorch analogy: torch.nn.Conv{d}d / torch.nn.functional.conv{d}d with groups=1 and
dilation=1.
Instances For
N-D transpose convolution layer for a channels-first tensor
(batch, inputChannels, spatial...).
Parameters:
- weight:
(inputChannels × outputChannels × kernelSize[0] × ... × kernelSize[rank-1]), - bias:
(outputChannels).
The output spatial shape uses:
output[a] = (input[a] - 1) * stride[a] - 2 * padding[a] + kernelSize[a]
(with output_padding = 0).
PyTorch analogy: torch.nn.ConvTranspose{d}d / torch.nn.functional.conv_transpose{d}d with
groups=1, dilation=1, and output_padding=0.
Instances For
N-D max pooling layer for a channels-first tensor (batch, channels, spatial...).
Output spatial dimensions follow Spec.poolOutSpatialPad.
PyTorch analogy: torch.nn.functional.max_pool{d}d on an N×C×... tensor.
Instances For
N-D average pooling layer for a channels-first tensor (batch, channels, spatial...).
PyTorch analogy: torch.nn.functional.avg_pool{d}d on an N×C×... tensor.