factorize#

Modules

Decomposes linear operators into pairs of smaller linear operators.

See Factorize or the Method Card for details.

Functions

apply_factorization

Replaces torch.nn.Linear and torch.nn.Conv2d modules with FactorizedLinear and FactorizedConv2d modules.

factorize_conv2d

Approximates a \(K \times K\) convolution by factorizing it into a \(K \times K\) convolution with fewer channels followed by a \(1 \times 1\) convolution.

factorize_matrix

Approximates a matrix by factorizing it into a product of two smaller matrices.

factorizing_could_speedup

Whether factorizing a module a given amount could possibly yield a benefit.

Classes

Factorize

Decomposes linear operators into pairs of smaller linear operators.

FactorizedConv2d

Factorized replacement for torch.nn.Conv2d.

FactorizedLinear

Factorized replacement for torch.nn.Linear.

LowRankSolution

Bundles tensors used by a factorized linear operator.