LoHa
6 memberslucid.peft.tuners.lohalucid.peft.tuners.loha — LoHa: a Hadamard product of low-rank products as the update.
LoHa (Hyeon-Woo et al., 2021, arXiv:2108.06098 — the FedPara parameterisation, in the LyCORIS form) learns . Two rank- factors multiplied elementwise reach rank for twice LoRA's parameters, and one of them starts at zero so the adapted model starts as the base. Pick it over LoRA when a higher-rank update is worth the extra parameters (the LyCORIS family is mostly used for diffusion models).
Where the reference library keeps them, so isinstance(m, LoHaLayer) and from lucid.peft.tuners.loha import Linear read as they do there. One layer type per module the method
adapts: Linear, Conv1d and Conv2d. LoHaConfig and LoHaModel are here and
exported from lucid.peft. Importing the package registers the method (its config under
PeftType.LOHA, its tuner and layers), which is what makes get_peft_model and
PeftModel.from_pretrained know it.
Hyeon-Woo, Nam, et al. "FedPara: Low-Rank Hadamard Product for Communication-Efficient Federated Learning." [arXiv:2108.06098](https://arxiv.org/abs/2108.06098), 2021.
LoHa (Hyeon-Woo et al., 2021, arXiv:2108.06098 — the FedPara parameterisation, in the LyCORIS form) learns a weight-shaped update as the Hadamard product of two low-rank products,
Classes
Conv1dAn nn.Conv1d with a LoHa update: the factored kernel is convolved with the base's stride, padding and groups.
Conv2dAn nn.Conv2d with a LoHa update: the factored kernel is convolved with the base's stride, padding and groups.
Linear1 methodsAn nn.Linear with a LoHa update: .
LoHaLayer18 methodsAdapter bookkeeping and the update shared by the LoHa layers.
LoHaConfig9 methodsHow lucid.peft.get_peft_model adapts a model with LoHa.
LoHaModel15 methodsA model with LoHa layers in it, and the tools to take them out again.