CorrDiffEra5Hrrr¶
NADS202680 GBNVIDIAPyTorch
Import path: earth2studio.models.dx.CorrDiffEra5Hrrr
View source on GitHub View install commands
Documentation¶
Bases: Module, AutoModelMixin
Generative downscaling from 0.25-degree ERA5 to 3 km HRRR over CONUS.
- High-resolution (3 km) HRRR state over the Continental United States (99 vars)
- High-resolution terrain and land-sea mask invariants
- Coarse-resolution (0.25 degree) ERA5 input state (26 vars)
The high-resolution grid is the HRRR Lambert conformal projection; the output
crop is the HRRR index window hrrr_lat_lim x hrrr_lon_lim of
StormCastCONUS ((17, 1041) x (3, 1795)
for the hosted model). The coarse input arrives on the native ERA5 footprint of
the training data; the source recommended by default_sources() serves it.
By default load_model loads the distilled 2-step generator of the model
(Parallel Decoding Distillation of the teacher's DiT); pass
load_model(..., distilled_model=False) for the 50-step teacher.
The model is [DomainAdaptable][earth2studio.models.base.DomainAdaptable]:
with_region returns a view covering the part of the HRRR crop that a
geographic box selects. The DiT is crop-size agnostic, so a view runs in one
forward over proportionally fewer tokens.
Parameters:
-
network(Module) –Conditioned network. For
network_kind="rectified_flow"aConcatConditionWrapper(DiT)whose output is the velocity or the clean data (seeprediction_type); fornetwork_kind="edm"anEDMPreconditioner(ConcatConditionWrapper(DiT))(an x0-predictor). -
lat_input_grid(Tensor) –1-D regular ERA5 input grid (the native training footprint). Latitude may be ascending or descending; input longitudes may use either the
[0, 360)or the[-180, 180)convention (compared modulo 360). -
lon_input_grid(Tensor) –1-D regular ERA5 input grid (the native training footprint). Latitude may be ascending or descending; input longitudes may use either the
[0, 360)or the[-180, 180)convention (compared modulo 360). -
lat_output_grid(Tensor) –2-D HRRR latitude / longitude
[H, W]of the output crop (degrees). -
lon_output_grid(Tensor) –2-D HRRR latitude / longitude
[H, W]of the output crop (degrees). -
y(Tensor) –1-D native HRRR projection coordinates (m) of the output crop.
-
x(Tensor) –1-D native HRRR projection coordinates (m) of the output crop.
-
era5_center(Tensor) –ERA5 input normalization (mean / std), size
[n_era5]. -
era5_scale(Tensor) –ERA5 input normalization (mean / std), size
[n_era5]. -
out_center(Tensor) –Output normalization (mean / std), size
[n_out]. -
out_scale(Tensor) –Output normalization (mean / std), size
[n_out]. -
invariants(Tensor) –Normalized static invariant channels
[n_inv, H, W], appended to the conditioning after the cosine-zenith channel. -
network_kind(Literal['rectified_flow', 'edm'], default:'rectified_flow') –Generative formulation, by default "rectified_flow"
-
era5_variables(Sequence[str], default:ERA5_VARIABLES) –Input channel order, by default
ERA5_VARIABLES -
output_variables(Sequence[str], default:OUTPUT_VARIABLES) –Output channel order, by default
OUTPUT_VARIABLES -
presence_flags(Sequence[str], default:()) –ERA5 variables that training randomly dropped from the input; one scalar "present" flag (always 1 at inference) per name.
-
day_of_year(bool, default:True) –Whether the scalar conditioning carries
[sin, cos]of the day-of-year phase at the validity time. -
prediction_type(Literal['x0', 'flow'], default:'x0') –Rectified-flow output parameterization. Ignored for EDM, by default "x0"
-
time_scale(float, default:999.0) –Multiplier applied to the rectified-flow time
t in [0, 1]before the network's timestep embedder (the examples train with999.0). -
number_of_samples(int, default:1) –Ensemble members per input; settable between calls.
-
number_of_steps(int, default:50) –ODE solver steps (each Heun step costs two network evaluations). For a distilled network this is the number of blocks of its rollout, 1 or 2.
-
solver((heun, euler), default:"heun") –ODE solver. Unused for a distilled network, whose rollout is fixed.
-
shift(float, default:32.0) –SD3 resolution shift
aapplied to the rectified-flow time grid,t -> a t / (1 + (a - 1) t);1.0disables it. The examples foundaof 12-32 optimal for full-domain sampling (the networks train on 256 x 256 patches). Ignored for EDM. Unused for a distilled network, which carries its own time grid. -
t_max(float, default:0.99) –Rectified-flow start time (the noise end); kept slightly below 1 for stability. Unused for a distilled network.
-
x0v_clip(float, default:0.05) –Lower clamp of the denominator in the x-prediction to velocity conversion
v = (x_t - x0_hat) / max(t, x0v_clip)near the data end (t -> 0). Unused for a distilled network, which stores its own value. -
sigma_min(float, default:0.01) –EDM Karras schedule parameters. Ignored for rectified flow.
-
sigma_max(float, default:0.01) –EDM Karras schedule parameters. Ignored for rectified flow.
-
rho(float, default:0.01) –EDM Karras schedule parameters. Ignored for rectified flow.
-
amp(bool, default:True) –Run network forwards under bf16 autocast while the ODE integration stays in fp32 (the examples' evaluation setting; roughly halves inference time).
__call__ ¶
load_default_package
classmethod
¶
load_default_package() -> Package
Default pre-trained model package.
Returns:
-
Package–Model package with default checkpoint location
load_model
classmethod
¶
load_model(
package: Package,
device: str | None = None,
number_of_samples: int | None = None,
number_of_steps: int | None = None,
amp: bool | None = None,
variant: Literal["x_pred"] = "x_pred",
distilled_model: bool = True,
) -> DiagnosticModel
Load the model from a package.
Parameters:
-
package(Package) –Model package to load from.
-
device(str | None, default:None) –Device to place the model on, by default None (CPU).
-
number_of_samples(int | None, default:None) –Ensemble members per input; defaults to the package metadata.
-
number_of_steps(int | None, default:None) –ODE steps for the teacher, or blocks (1 or 2) for the distilled generator; defaults to the package metadata. The rest of the sampling schedule (solver, time shift,
t_max,x0v_clip) always comes from the package: it is tied to how the networks were trained. -
amp(bool | None, default:None) –bf16 autocast for the network; defaults to the package metadata.
-
variant(x_pred, default:"x_pred") –Sub-folder of the package to load, by default
"x_pred"(the x-prediction rectified-flow model). -
distilled_model(bool, default:True) –Whether to use the distilled model. If True, the wrapper loads the distilled few-step generator (
corrdiff-era5-hrrr-distil.mdlusin the same package), which generates members in 1 or 2 sampler steps (number_of_stepsdefaults to 2) at a fraction of the teacher's cost. Its sampling schedule is fixed by the checkpoint. If False, it loads the teacher sampled with 50 Heun steps, by default True
Returns:
-
DiagnosticModel–Loaded model.