data
LoraGAConfig
LoraGAConfig(direction: Literal['ArBr', 'A2rBr', 'ArB2r', 'random'] = 'ArB2r', scale: Literal['stable', 'weight_svd', 'gd_scale', 'unit'] = 'stable', stable_gamma: int = 16)Configuration for LoRA-GA (Gradient Approximation) initialisation.
LoRA-GA (Wang et al., 2024, arXiv:2407.05000) estimates full-model weight
gradients over a calibration step (lucid.peft.preprocess_loraga),
aligned via low-rank SVD into and , and subtracts
from the base weight so the adapted layer starts at the
pretrained function while its first gradient step matches full fine-tuning.
Parameters
direction(ArBr, A2rBr, ArB2r, random)= "ArBr"How the top- singular vectors of the gradient are partitioned
between and .
scale(stable, weight_svd, gd_scale, unit)= "stable"How the initialised factors are scaled.
stable_ gammaint= 16Denominator hyperparameter for
scale="stable".Raises
ValueErrordirection or scale is unknown, or stable_gamma <= 0.Examples
>>> from lucid.peft import LoraGAConfig
>>> cfg = LoraGAConfig(direction="ArB2r", scale="stable", stable_gamma=16)
>>> cfg.direction, cfg.scale
('ArB2r', 'stable')