| # Normalization files |
|
|
| This folder provides the normalization (standardization) parameters used for FuXi-CFD inference. |
|
|
| ## Overview |
| - Inputs are standardized before being fed to the ONNX model. |
| - Model outputs are de-standardized back to physical scale after inference. |
|
|
| ## Files |
| - `scaler_input.npy` : dict of input normalization stats (mean/std) for static/dynamic input variables |
| - `scaler_output.npy` : dict of output normalization stats (mean/std) for model outputs |
| Both are stored as Python dicts inside `.npy` (load with `allow_pickle=True`). |
|
|
| ## Input normalization (`scaler_input.npy`) |
| Keys: |
| - `low_mean`, `low_std` for low-res dynamic inputs: `["u_100m", "v_100m"]` |
| - `high_mean`, `high_std` for high-res static inputs: `["dem", "roughness"]` |
| |
| Final ONNX input channel order **must** be: |
| `[u_100m, v_100m, dem, roughness]` (C=4) |
| |
| ## Output de-normalization (`scaler_output.npy`) |
| Keys: |
| - `mean`, `std`: arrays of shape `(27, 4)` (levels=27, vars=4) |
|
|
| Output variable order: |
| `[u, v, w, k]` |
|
|
| The ONNX model output tensor is expected as: |
| `(1, 27, 4, 300, 300)` and de-normalization applies: |
| `pred = pred * std + mean` (broadcast on `(300,300)`) |
|
|
| ## Example loading |
| ```python |
| import numpy as np |
| in_stats = np.load("normalization/scaler_input.npy", allow_pickle=True).item() |
| out_stats = np.load("normalization/scaler_output.npy", allow_pickle=True).item() |
| ``` |
|
|