Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear whose low singular directions train: .
Parameters
Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft import OSFConfig
>>> from lucid.peft.tuners.osf import Linear
>>> base = nn.Linear(8, 6)
>>> layer = Linear(base, "default", OSFConfig(effective_rank=2, target_modules=["x"]))
>>> {name: tuple(p.shape) for name, p in layer.osf_svd_params["default"].items()}
{'U_low': (6, 4), 'S_low': (4,), 'V_low': (4, 8)}
>>> x = lucid.randn(3, 8)
>>> bool((layer(x) == base(x)).all().item()) # the trained part starts as the weight's own
True