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:
ModuleA specialized type of g-net that uses low-rank matrix decomposition to compute the parameters of a layer.
- Parameters:
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.