sup3r.preprocessing.derivers.methods.SpatioTemporalEncoding#
- class SpatioTemporalEncoding[source]#
Bases:
DerivedFeatureGeneral positional or temporal encoding.
References
[cong2022]Cong, Yezhen, et al. “Satmae: Pre-training transformers for
temporal and multi-spectral satellite imagery.” Advances in Neural Information Processing Systems 35 (2022): 197-211.
Note
We use the referenced paper for inspiration but modify the argument of the trig functions to be 2πi * k / d so the periodicity matches the underlying feature (e.g. hour of day repeats every 24 hours).
Methods
compute(data, **kwargs)Compute method for derived feature.
Attributes
inputs- abstract classmethod compute(data: Sup3rX | Sup3rDataset, **kwargs)#
Compute method for derived feature. This can use any of the features contained in the xr.Dataset data and the attributes (e.g. .lat_lon, .time_index accessed through Sup3rX accessor).
- Parameters:
data (Union[Sup3rX, Sup3rDataset]) – Initialized and standardized through a
Loaderwith a specific spatiotemporal extent rasterized for the features contained using aRasterizer.kwargs (dict) – Optional keyword arguments used in derivation. height is a typical example. Could also be pressure.