rslearn.train.callbacks.peft¶
peft ¶
Parameter-efficient finetuning callbacks.
SplitProjection ¶
Bases: Module
Split projection weights into trainable and frozen parts.
This module is used to split the projection weights into trainable and frozen parts. The trainable part is used to compute the output, and the frozen part is used to compute the output without gradients.
Source code in rslearn/train/callbacks/peft.py
forward ¶
Forward pass of the SplitProjection module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
the input tensor |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
the output tensor |
Source code in rslearn/train/callbacks/peft.py
APLA ¶
Bases: BaseFinetuning
APLA (https://arxiv.org/pdf/2503.11335v2) finetuning callback.
Source code in rslearn/train/callbacks/peft.py
freeze_before_training ¶
Freeze the model before training.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pl_module
|
LightningModule
|
the LightningModule |
required |
Source code in rslearn/train/callbacks/peft.py
finetune_function ¶
Do nothing here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pl_module
|
LightningModule
|
the LightningModule |
required |
current_epoch
|
int
|
the current epoch |
required |
optimizer
|
Optimizer
|
the optimizer |
required |