credit.postblock.scaler#
Classes#
Scaling postblock using a fitted bridgescaler dict. |
Module Contents#
- class credit.postblock.scaler.BridgeScalerTransformer(scaler_path: str, variables: list[str], method: str, key: str = 'y_processed')#
Bases:
credit.postblock.base.BasePostblockScaling postblock using a fitted bridgescaler dict.
Applies per-variable scaling (or its inverse) to the nested prediction dict at
batch_dict[key], which has the formbatch_dict[key][source][var_key]wherevar_keyis"source/field_type/dim/varname"(e.g."era5/prognostic/3d/T").Defaults to operating on
"y_processed"— the nested dict written byReconstruct. Usemethod="inverse_transform"to convert normalized predictions back to physical units before physics fixers.The scaler dict must have been fit with
bridgescaler.scale_var_dictusing the same nested structure and saved withbridgescaler.save_scaler_dict.Example config:
type: "bridgescaler_transform" args: scaler_path: "/path/to/scaler.json" variables: - "era5/prognostic/3d/T" - "era5/prognostic/3d/U" method: "inverse_transform"
- variables#
- method#
- scaler_path#
- key = 'y_processed'#
- scaler#
- forward(batch_dict: dict) dict#