torchGB.layers.matrix_decomposition package

Submodules

torchGB.layers.matrix_decomposition.attn_low_rank module

torchGB.layers.matrix_decomposition.conv_low_rank module

torchGB.layers.matrix_decomposition.linear_low_rank module

torchGB.layers.matrix_decomposition.model module

class torchGB.layers.matrix_decomposition.model.LowRankMatrixDecompositionGNet(sizes: Sequence[int], rank: int = 32)[source]

Bases: Module

A specialized type of g-net that uses low-rank matrix decomposition to compute the parameters of a layer.

Parameters:
  • sizes (Sequence[int) – The input and output sizes of the layer.

  • rank (int, optional) – Rank for the matrix decomposition. Defaults to 32.

forward(x: Tensor) Tensor[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

output_scale: float
sizes: Sequence[int]

Module contents