credit.postblock.exp#
Classes#
Inverse of the LogTransform preblock: converts log-space values to physical space. |
Module Contents#
- class credit.postblock.exp.ExpTransform(variables: list[str], eps: float = 1e-08, base: str = 'e', key: str = 'y_processed')#
Bases:
credit.postblock.base.BasePostblockInverse of the LogTransform preblock: converts log-space values to physical space.
Inverts
y = log_base(x + eps) - log_base(eps)back tox = base^(y + log_base(eps)) - eps.epsandbasemust match those used in the corresponding LogTransform preblock.variablessupports the same shorthand as the scaler: an empty list transforms every variable; partial paths (e.g."era5/prognostic") expand to all variables under that hierarchy. Expansion happens lazily on the first forward call.Config example:
type: "exp_transform" args: variables: - "era5/prognostic/3d/Q" eps: 1.0e-8 # must match LogTransform eps base: "e" # must match LogTransform base # or inverse-transform all variables: type: "exp_transform" args: variables: []
- variables#
- variables_expanded = False#
- key = 'y_processed'#
- _eps#
- _base = 'e'#
- _exp(x: torch.Tensor) torch.Tensor#
Apply base-specific exponentiation: e^x, 2^x, or 10^x.
- forward(batch_dict: dict) dict#