ncdl.nn.LatticeConvolution

class ncdl.nn.LatticeConvolution(*args: Any, **kwargs: Any)

Implements the ``convolution’’ (technically, cross-correlation) operation for LatticeTensors. This interface is meant to be as similar as possible to nn.Conv2d. However, we don’t support dilation and strided convolution. It’s possible to do both of these, however the implementation is very intricate (we need to fuse both the downsampling and conv operations). Currently, simply use ncdl.nn.functional.downsample to get the downsample operation.

We also don’t support transposed convolution. Mainly because there’s no need. The only real benefit to to transposed convs is that they increase resolution. You can acheive the same effect (with more flexibility) with ncdl.nn.functional.upsample followed by a lattice conv.

We also don’t directly support dilation – if you want to dilate your filter, then simply dilate your filter before instantiating this object.

__init__(lattice: Lattice, channels_in: int, channels_out: int, stencil: Stencil, groups: int = 1, bias: bool = True)
Parameters:
  • lattice

  • channels_in

Methods

__init__(lattice, channels_in, channels_out, ...)

param lattice:

forward(lt)

get_convolution_weights(coset_id)

Returns the /square/ convolution weights for this coset.

reset_parameters()