Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear with a DEFT update: .
Parameters
base_ layernn.LinearThe layer to adapt; the other parameters are those of
DeftLayer.adapter_ namestrName of the first adapter.
configDeftConfigr, decomposition_method, init_scale, alpha, para, deft_dropout and
init_weights.Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft import DeftConfig
>>> from lucid.peft.tuners.deft import Linear
>>> base = nn.Linear(8, 4)
>>> layer = Linear(base, "default", DeftConfig(r=2, target_modules=["x"]))
>>> tuple(layer.deft_P["default"].shape), tuple(layer.deft_R["default"].shape)
((4, 2), (2, 8))
>>> x = lucid.randn(3, 8)
>>> bool(lucid.allclose(layer(x), base(x), atol=1e-5)) # R starts where the update is zero
True