Skip to content
class

SVDConv2d

extendsAdaLoraLayer
SVDConv2d(base_layer: nn.Module, adapter_name: str, config: AdaLoraConfig, r: int = 0, lora_alpha: float = 1)

An nn.Conv2d whose update is an SVD-parameterised kernel, applied as the base applies its own.

lora_A is (r, in_channels / groups * kH * kW) and the product P diag(λ) QP\,\mathrm{diag}(\lambda)\,Q is reshaped to the base kernel; the stride, padding, dilation and groups are the base's.

Parameters

base_layernn.Conv2d
The layer to adapt; the other parameters are those of SVDLinear.
adapter_namestr
Name of the adapter created at once (update_layer).
The config; dropout and init_lora_weights are read.
rint= 0
Initial rank — the number of singular triplets; 0 is allowed, as in the reference (a layer the allocator pruned away entirely).
lora_alphafloat= 1
Numerator of the scale; 0 or below takes r.

Used by 1