credit.transforms404#
Attributes#
Classes#
(De/)Normalize C404 data by variable. Currently only does |
|
Converts xarray object to torch tensor. Defined as a class so |
Module Contents#
- credit.transforms404.logger#
- class credit.transforms404.NormalizeState(conf)#
(De/)Normalize C404 data by variable. Currently only does z-score normalization using precomputed mu & sigma.
- mean_ds#
- std_ds#
- variables#
- __call__(sample: credit.data.Sample, inverse: bool = False) credit.data.Sample#
- transform(sample: Dict[str, numpy.ndarray]) Dict[str, numpy.ndarray]#
- inverse_transform(x: torch.Tensor) torch.Tensor#
- class credit.transforms404.ToTensor(conf, x0=120, xsize=512, y0=300, ysize=512)#
Converts xarray object to torch tensor. Defined as a class so it can be used as a component of a string of transforms applied to C404Dataset’s __getitem__ calls. Also does spatial cropping (which probably ought to move elsewhere, likely into another transform sequence component object).
- conf#
- hist_len#
- for_len#
- variables#
- static_variables#
- slice_x#
- slice_y#
- __call__(sample: credit.data.Sample) credit.data.Sample#