AI术语词典

A comprehensive multilingual AI terminology dictionary

Definition

LoRA冻结预训练模型的权重,并在Transformer架构的每一层中插入可训练的分解矩阵。通过仅优化这些低秩矩阵,LoRA显著减少

Summary

低秩自适应是一种参数高效的微调方法,它将可训练的秩分解矩阵注入现有模型权重中。

Key Concepts

Use Cases

Code Example

1
2
3
from peft import LoraConfig, get_peft_model
config = LoraConfig(r=8, lora_alpha=32)
model = get_peft_model(base_model, config)