Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear with a VB-LoRA update: .
Parameters
base_ layernn.LinearThe layer to adapt; the other parameters are those of
VBLoRALayer.adapter_ namestrName of the adapter created at once.
configVBLoRAConfigThe adapter's config.
Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft.tuners.vblora import Linear, VBLoRAConfig
>>> base = nn.Linear(8, 4)
>>> config = VBLoRAConfig(r=2, num_vectors=6, vector_length=4, target_modules=["x"])
>>> layer = Linear(base, "default", config)
>>> tuple(layer.vblora_logits_A["default"].shape), tuple(layer.vblora_logits_B["default"].shape)
((2, 2, 6), (1, 2, 6))
>>> tuple(layer.vblora_vector_bank["default"].shape)
(6, 4)
>>> tuple(layer(lucid.randn(3, 8)).shape)
(3, 4)