U-Net #
A typed encoder-decoder with one downsampling stage, one upsampling stage, and a channel-wise skip connection. The spatial rank is a parameter: the same constructor applies to sequences, images, volumes, and higher-dimensional grids.
The reusable operations remain visible in the type. Pooling determines the bottleneck extent,
transpose convolution returns it to the input extent, and branch concatenation changes the channel
count from baseChannels to baseChannels + baseChannels.
Reference: O. Ronneberger, P. Fischer, and T. Brox, "U-Net: Convolutional Networks for Biomedical Image Segmentation," MICCAI 2015.
Configuration for a one-level U-Net over d spatial axes.
- inputChannels : ℕ
Number of channels in each input sample.
- baseChannels : ℕ
Width of the full-resolution feature map.
- outputChannels : ℕ
Number of channels produced by the output projection.
Size of each input axis.
- pooling : Pooling.Config d
Downsampling operation.
Radius of the same-padding kernels used at both resolutions.
A radius of
1gives kernel size3; these convolutions preserve their grids automatically.- upsampling : Convolution.Geometry d
Geometry used by the transpose convolution that restores full resolution.
Instances For
Build a one-level U-Net over an arbitrary spatial rank.
Same-padding convolutions preserve both resolutions automatically. Model validation rejects an empty input or pooled grid, or a pooling/upsampling pair that does not restore the input grid.