TemporalRegressionTask#
- class torchgeo.trainers.TemporalRegressionTask(model='ltae', in_channels=1, num_outputs=1, labels=None, out_steps=1, loss='mse', lr=0.001, patience=10, **kwargs)[source]#
Bases:
RegressionMixin,BaseTaskTrainer for sequence-to-sequence temporal regression.
Added in version 0.10.
- __init__(model='ltae', in_channels=1, num_outputs=1, labels=None, out_steps=1, loss='mse', lr=0.001, patience=10, **kwargs)[source]#
Initialize a new TemporalRegressionTask instance.
- Parameters:
model (Literal['ltae']) – Name of the model architecture.
in_channels (int) – Number of input features per time step (the C dimension of the (B, T, C) input tensor).
num_outputs (int) – Number of output features per time step (the C dimension of the (B, T, C) target tensor).
out_steps (int) – Number of output time steps (the T dimension of the (B, T, C) target tensor).
loss (Literal['mae', 'mse']) – Loss function.
lr (float) – Learning rate for optimizer.
patience (int) – Patience for learning rate scheduler.
**kwargs (Any) – Additional keyword arguments passed to the model constructor.
Added in version 0.10.
- training_step(batch, batch_idx, dataloader_idx=0)[source]#
Compute the training loss and additional metrics.
- validation_step(batch, batch_idx, dataloader_idx=0)[source]#
Compute the validation loss and additional metrics.
- test_step(batch, batch_idx, dataloader_idx=0)[source]#
Compute the test loss and additional metrics.