HRA
5 memberslucid.peft.tuners.hralucid.peft.tuners.hra — HRA: a chain of learned Householder reflections.
HRA (Yuan et al., 2024, arXiv:2405.17484 — Householder Reflection Adaptation) multiplies a weight
from the right by Householder reflections,
, an orthogonal transform of the input space
whose only parameters are the vectors . With an even r it starts as the
identity, and it folds into the weight. The paper presents it as a bridge between low-rank and
orthogonal adaptation: pick it for an orthogonal method that costs parameters
per layer.
Where the reference library keeps them, so isinstance(m, HRALayer) and from lucid.peft.tuners.hra import HRAConfig, Linear read as they do there. One layer type per module
the method adapts: Linear and Conv2d. HRAConfig and HRAModel are here and exported
from lucid.peft. Importing the package registers the method (its config under PeftType.HRA,
its tuner and layers), which is what makes get_peft_model and PeftModel.from_pretrained know
it.
Yuan, Shen, et al. "Bridging the Gap between Low-rank and Orthogonal Adaptation via Householder Reflection Adaptation." [arXiv:2405.17484](https://arxiv.org/abs/2405.17484), 2024.
HRA (Yuan et al., 2024, arXiv:2405.17484 — Householder Reflection Adaptation) multiplies each targeted weight from the right by a chain of Householder reflections,
Classes
HRAConfig9 methodsHow lucid.peft.get_peft_model adapts a model with HRA.
Conv2dAn nn.Conv2d with HRA reflections of its flattened in x kernel axis: the convolution runs with the transformed filters.
HRALayer20 methodsAdapter bookkeeping and the reflection chain shared by the HRA layers.
LinearAn nn.Linear with HRA reflections of its input: .
HRAModel15 methodsA model with HRA layers in it, and the tools to take them out again.