geowatch.tasks.fusion.utils module¶
- geowatch.tasks.fusion.utils.load_model_from_package(package_path, with_header=False)[source]¶
Loads a kitware-flavor torch package (requires a package_header exists)
Notes
I don’t like that we need to know module_name and arch_name a-priori given a path to a package, I just want to be able to construct the model instance. The package header solves this.
- geowatch.tasks.fusion.utils.load_model_header(package_path)[source]¶
Only grabs header info from a packaged model.
- class geowatch.tasks.fusion.utils.SinePositionalEncoding(dest_dim, dim_to_encode, size=4)[source]¶
Bases:
Module
- Parameters:
dest_dim (int) – feature dimension to concat to
dim_to_encode (int) – dimension encoding is supposed to represent
size (int) – number of different encodings for the dim_to_encode
Example
>>> from geowatch.tasks.fusion.utils import * # NOQA >>> dest_dim = 3 >>> dim_to_encode = 2 >>> size = 8 >>> self = SinePositionalEncoding(dest_dim, dim_to_encode, size=size) >>> x = torch.rand(3, 5, 7, 11, 13) >>> y = self(x)