ConvLSTM#
- class torchgeo.models.ConvLSTM(input_dim, hidden_dim, kernel_size, num_layers, batch_first=True, bias=True, return_all_layers=False)[source]#
Bases:
ModuleConvolutional LSTM model.
This model is a sequence-processing model that uses convolutional operations within the LSTM cells. It is particularly useful for spatio-temporal data.
If you use this model in your research, please cite the following paper:
Added in version 0.8.
- __init__(input_dim, hidden_dim, kernel_size, num_layers, batch_first=True, bias=True, return_all_layers=False)[source]#
Initializes the ConvLSTM model.
- Parameters:
input_dim (int) – Number of channels in the input.
hidden_dim (int | list[int]) – Number of hidden channels. Can be a single int (for all layers) or a list of ints (one for each layer).
kernel_size (int | tuple[int, int] | list[int | tuple[int, int]]) –
Size of the convolutional kernel. Can be:
a single integer (for square kernels)
a tuple of two integers (for rectangular kernels)
a list of integers or tuples (one for each layer)
num_layers (int) – Number of LSTM layers stacked on each other.
batch_first (bool) – If
True, then the input and output tensors are provided as (b, t, c, h, w).bias (bool) – If
True, adds a learnable bias to the output.return_all_layers (bool) – If
True, will return the list of computations for all layers.