MOSAIKS#
- class torchgeo.models.MOSAIKS(dataset, in_channels=3, features=4096, kernel_size=4, bias=-1.0, seed=None)[source]#
Bases:
RCFMOSAIKS RCF model with the recommended parameters defined in the paper.
If you use this model in your research, please cite the following paper:
Note
This Module is not trainable. It is only used as a feature extractor.
Added in version 0.8.
- __init__(dataset, in_channels=3, features=4096, kernel_size=4, bias=-1.0, seed=None)[source]#
Initializes the MOSAIKS model.
- Parameters:
dataset (NonGeoDataset) – a NonGeoDataset to sample from
in_channels (int) – number of input channels
features (int) – number of features to compute, must be divisible by 2
kernel_size (int) – size of the kernel used to compute the RCFs
bias (float) – bias of the convolutional layer
seed (int | None) – random seed used to initialize the convolutional layer
- class torchgeo.models.RCF(in_channels=4, features=16, kernel_size=3, bias=-1.0, seed=None, mode='gaussian', dataset=None)[source]#
Bases:
ModuleThis model extracts random convolutional features (RCFs) from its input.
RCFs are used in the Multi-task Observation using Satellite Imagery & Kitchen Sinks (MOSAIKS) method proposed in “A generalizable and accessible approach to machine learning with global satellite imagery”.
This class can operate in two modes, “gaussian” and “empirical”. In “gaussian” mode, the filters will be sampled from a Gaussian distribution, while in “empirical” mode, the filters will be sampled from a dataset.
If you use this model in your research, please cite the following paper:
Note
This Module is not trainable. It is only used as a feature extractor.
- __init__(in_channels=4, features=16, kernel_size=3, bias=-1.0, seed=None, mode='gaussian', dataset=None)[source]#
Initializes the RCF model.
This is a static model that serves to extract fixed length feature vectors from input patches.
Added in version 0.2: The seed parameter.
Added in version 0.5: The mode and dataset parameters.
- Parameters:
in_channels (int) – number of input channels
features (int) – number of features to compute, must be divisible by 2
kernel_size (int) – size of the kernel used to compute the RCFs
bias (float) – bias of the convolutional layer
seed (int | None) – random seed used to initialize the convolutional layer
mode (str) – “empirical” or “gaussian”
dataset (NonGeoDataset | None) – a NonGeoDataset to sample from when mode is “empirical”