torch.nn.MaxUnpool3d
class MaxUnpool3d extends Modulenew MaxUnpool3d(kernel_size: number | [number, number, number], options?: MaxUnpool3dOptions)
- readonly
kernel_size(number | [number, number, number]) - readonly
stride(number | [number, number, number]) - readonly
padding(number | [number, number, number])
3D max unpooling: reconstructs volumetric tensor from MaxPool3d output and indices.
Inverse operation of MaxPool3d for 3D spatial/volumetric data. Essential for:
- 3D deconvolution networks (medical imaging, video upsampling)
- 3D encoder-decoder architectures
- Volumetric feature reconstruction
- 3D segmentation upsampling paths
Places pooled values at recorded max positions, zeros elsewhere.
- 3D volumetric unpooling: Reconstructs depth, height, width
- Memory intensive: 3D operations use significant memory
- Indices required: Must use MaxPool3d(return_indices=true)
- Information loss: Non-max volumetric values unrecoverable
- Memory intensive: 3D unpooling expensive operation
- Parameter matching: Kernel/stride/padding must match MaxPool3d
Examples
// 3D volumetric unpooling
const pool = new torch.nn.MaxPool3d(2, 2, 0, true); // return_indices=true
const x = torch.randn([4, 64, 64, 64, 64]);
const [pooled, indices] = pool.forward(x) as [torch.Tensor, torch.Tensor]; // [4, 64, 32, 32, 32]
const unpool = new torch.nn.MaxUnpool3d(2, 2);
const reconstructed = unpool.unpool(pooled, indices); // [4, 64, 64, 64, 64]