Implementing kernel
C++ engine symbols that back this Python API.An nn.Linear with a WaveFT update: .
Parameters
base_ layernn.LinearThe layer to adapt; the other parameters are those of
WaveFTLayer.adapter_ namestrName of the first adapter.
configWaveFTConfigThe adapter's config (its
n_frequency is this layer's).Examples
>>> import lucid
>>> import lucid.nn as nn
>>> from lucid.peft import WaveFTConfig
>>> from lucid.peft.tuners.waveft import Linear
>>> base = nn.Linear(8, 4)
>>> layer = Linear(base, "default", WaveFTConfig(n_frequency=5, target_modules=["x"]))
>>> tuple(layer.waveft_spectrum["default"].shape)
(5,)
>>> x = lucid.randn(3, 8)
>>> bool((layer(x) == base(x)).all().item()) # the coefficients start at zero
True