Convolution Modules #
Convolution modules are parameterized by vectors of spatial extents. The same definitions cover one-dimensional sequences, images, volumes, and higher-rank spatial data.
def
Spec.Module.conv
{α : Type}
[TorchLean.Storage α]
[Context α]
{d inC outC : ℕ}
{kernel stride padding inSpatial : TorchLean.Tensor ℕ [d]}
(m : ConvSpec d inC outC kernel stride padding α)
:
Module α (Shape.ofList (inC :: inSpatial.to (List ℕ)))
(Shape.ofList (outC :: (convOutSpatial inSpatial kernel stride padding).to (List ℕ)))
Wrap an arbitrary-rank channels-first convolution as a Spec.Module.
Instances For
def
Spec.Module.convTranspose
{α : Type}
[TorchLean.Storage α]
[Context α]
{d inC outC : ℕ}
{kernel stride padding inSpatial : TorchLean.Tensor ℕ [d]}
(m : ConvTransposeSpec d inC outC kernel stride padding α)
:
Module α (Shape.ofList (inC :: inSpatial.to (List ℕ)))
(Shape.ofList (outC :: (convTransposeOutSpatial inSpatial kernel stride padding).to (List ℕ)))
Wrap an arbitrary-rank channels-first transposed convolution as a Spec.Module.