SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.10422 · NeurIPS · 2023

PreDiff: Precipitation Nowcasting with Latent Diffusion Models

Hao Wang, Danielle Maddix, Yuyang Wang, Yi Zhu, Mu Li, Xingjian Shi, Zhihan Gao, Boran Han, Boson Ai, Xiaoyong Jin, † Boson

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2307.10422.json · badge: /api/ran/2307.10422.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
gaozhihan/PreDiff community (classifier label)
classifier basis not recorded on the link
9 ran · 3 no recorded run
FunctionStatusWhere it lives
downsample_2d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhihan/PreDiff/src/prediff/taming/resnet.py
code served (permissive licence) · get_code("f46bcb6099334fa6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small batch of 2D images with shape [N, C, H, W]
# N=2 (batch size), C=3 (channels), H=8 (height), W=8 (width)
hidden_states = torch.randn(2, 3, 8, 8)

# Create a kernel - can be 1D or 2D
# Using a simple 1D kernel that will be converted to 2D via outer product
kernel = [1, 1]

# Downsampling factor
factor = 2

# Gain scaling factor
gain = 1.0

ARGS = {
    "hidden_states": hidden_states,
    "kernel": kernel,
    "factor": factor,
    "gain": gain,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_beta_schedule Ran
ran, honoured the contract we drafted
gaozhihan/PreDiff/src/prediff/diffusion/utils.py
code served (permissive licence) · get_code("3bd7e0cdbd131fdb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (10,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    'schedule': 'linear',
    'n_timestep': 10,
    'linear_start': 0.0001,
    'linear_end': 0.02,
    'cosine_s': 0.008
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_ddim_sampling_parameters Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhihan/PreDiff/src/prediff/diffusion/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from haoheliu/AudioLDM, is pointer only (licence: NOASSERTION) · get_code("3ee640131c9d4362")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from haoheliu/AudioLDM, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_ddim_timesteps Ran
ran, honoured the contract we drafted
gaozhihan/PreDiff/src/prediff/diffusion/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from haoheliu/AudioLDM, is pointer only (licence: NOASSERTION) · get_code("0ea4e960ea54514c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from haoheliu/AudioLDM, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normal_kl Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhihan/PreDiff/src/prediff/utils/distributions.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from NeuralCarver/Michelangelo, is pointer only (licence: GPL-3.0) · get_code("17eb0a31c91b671c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from NeuralCarver/Michelangelo, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rearrange_dims Ran
ran, honoured the contract we drafted
gaozhihan/PreDiff/src/prediff/taming/resnet.py
code served (permissive licence) · get_code("a191f9f21d279753")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 1) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function rearrange_dims takes a tensor and reshapes it based on its dimensionality
# It expects tensors with 2, 3, or 4 dimensions
# We'll create test cases for each valid dimension count

# Case 1: 2D tensor (batch_size=2, features=4)
tensor_2d = torch.randn(2, 4)

# Case 2: 3D tensor (batch_size=2, dim1=4, dim2=3)
tensor_3d = torch.randn(2, 4, 3)

# Case 3: 4D tensor (batch_size=2, dim1=4, dim2=3, dim3=5)
tensor_4d = torch.randn(2, 4, 3, 5)

# Test with 2D tensor as the primary case
ARGS = {
    "tensor": tensor_2d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 1) — shape (2, 4, 1) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
timestep_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhihan/PreDiff/src/prediff/models/utils.py
code served (permissive licence) · get_code("7e83c65f054fb972")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math
from einops import repeat

torch.manual_seed(0)

# Create timesteps tensor: 1-D tensor of N indices
timesteps = torch.tensor([0.0, 1.0], dtype=torch.float32)

# Create dimension parameter
dim = 4

# Create max_period parameter
max_period = 10000

# Create repeat_only parameter
repeat_only = False

ARGS = {
    "timesteps": timesteps,
    "dim": dim,
    "max_period": max_period,
    "repeat_only": repeat_only,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upsample_2d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhihan/PreDiff/src/prediff/taming/resnet.py
code served (permissive licence) · get_code("31e7ed79c46ee9a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 6, 10) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small input tensor [N, C, H, W]
hidden_states = torch.randn(2, 4, 3, 5)

# Create a simple kernel (1D that will be converted to 2D)
kernel = [1.0, 1.0]

# Upsampling factor
factor = 2

# Gain scaling factor
gain = 1.0

ARGS = {
    "hidden_states": hidden_states,
    "kernel": kernel,
    "factor": factor,
    "gain": gain,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 6, 10) — shape (2, 4, 6, 10) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
zero_module Ran
ran; our contract draft was wrong, not the code
gaozhihan/PreDiff/src/prediff/models/utils.py
code served (permissive licence) · get_code("129b804760b3115f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned SimpleModule. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple module with some parameters
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.conv = nn.Conv1d(2, 2, 3)
    
    def forward(self, x):
        return x

module = SimpleModule()

# Verify the module has non-zero parameters before zeroing
for p in module.parameters():
    assert p.abs().sum() > 0, "Parameters should be non-zero initially"

ARGS = {
    "module": module
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModule — a SimpleModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
checkpoint Not yet run
unverified (harvested, no recorded run)
gaozhihan/PreDiff/src/prediff/models/utils.py
code served (permissive licence) · get_code("6fe195fcfd10e259")
How it ran

no invocation recorded.

get_down_block Not yet run
unverified (harvested, no recorded run)
gaozhihan/PreDiff/src/prediff/taming/unet_2d_blocks.py
code served (permissive licence) · get_code("333f0e96a20e3d88")
How it ran

no invocation recorded.

get_up_block Not yet run
unverified (harvested, no recorded run)
gaozhihan/PreDiff/src/prediff/taming/unet_2d_blocks.py
code served (permissive licence) · get_code("8f6fe233efb4c95a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 3 the same month, 10 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
zero_module 196 other papers
55 dated earlier, 5 the same month, 135 later, 1 same year, order not determinable · 49 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2105.05233 (2021-05)
Diffusion Models Beat GANs on Image Synthesis
and 193 more not named here
checkpoint 51 other papers
17 dated earlier, 2 the same month, 32 later · 29 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2105.05233 (2021-05)
Diffusion Models Beat GANs on Image Synthesis
2110.11291 (2021-10)
Likelihood Training of Schrödinger Bridge using Forward-Backward SDEs Theory
and 48 more not named here
normal_kl 34 other papers
5 dated earlier, 28 later, 1 same year, order not determinable
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2209.15421 (2022-09)
TabDDPM: Modelling Tabular Data with Diffusion Models
2211.13221 (2022-11)
Latent Video Diffusion Models for High-Fidelity Long Video Generation
and 31 more not named here
make_beta_schedule 29 other papers
5 dated earlier, 23 later, 1 same year, order not determinable · 7 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2206.02262 (2022-06)
Diffusion-GAN: Training GANs with Diffusion
2211.10658 (2022-11)
EDGE: Editable Dance Generation From Music
and 26 more not named here
timestep_embedding 25 other papers
5 dated earlier, 1 the same month, 19 later · 8 only as an assembly brick
2202.06875 (2022-02)
Visual Acoustic Matching
2301.05225 (2023-01)
Domain Expansion of Image Generators
2302.07685 (2023-02)
Video Probabilistic Diffusion Models in Projected Latent Space
and 22 more not named here
make_ddim_timesteps 15 other papers
3 dated earlier, 11 later, 1 same year, order not determinable · 4 only as an assembly brick
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2202.09778 (2022-02)
Pseudo Numerical Methods for Diffusion Models on Manifolds
Xu_Versatile_Diffusion_Text_Images_and_Variations_All_in_One_Diffusion_ICCV_2023_paper (2023 (year only))
Versatile Diffusion: Text, Images and Variations All in One Diffusion Model
and 12 more not named here
make_ddim_sampling_parameters 10 other papers
3 dated earlier, 6 later, 1 same year, order not determinable · 4 only as an assembly brick
2010.02502 (2020-10)
Denoising Diffusion Implicit Models
2202.09778 (2022-02)
Pseudo Numerical Methods for Diffusion Models on Manifolds
Xu_Versatile_Diffusion_Text_Images_and_Variations_All_in_One_Diffusion_ICCV_2023_paper (2023 (year only))
Versatile Diffusion: Text, Images and Variations All in One Diffusion Model
and 7 more not named here
downsample_2d 7 other papers
2 dated earlier, 5 later
2303.09535 (2023-03)
FateZero: Fusing Attentions for Zero-shot Text-based Video Editing
2304.06720 (2023-04)
Expressive Text-to-Image Generation with Rich Text
2310.01107 (2023-10)
Ground-A-Video: Zero-shot Grounded Video Editing using Text-to-image Diffusion Models
and 4 more not named here
upsample_2d 7 other papers
2 dated earlier, 5 later
2303.09535 (2023-03)
FateZero: Fusing Attentions for Zero-shot Text-based Video Editing
2304.06720 (2023-04)
Expressive Text-to-Image Generation with Rich Text
2310.01107 (2023-10)
Ground-A-Video: Zero-shot Grounded Video Editing using Text-to-image Diffusion Models
and 4 more not named here
rearrange_dims 3 other papers
1 dated earlier, 2 later
2304.06720 (2023-04)
Expressive Text-to-Image Generation with Rich Text
2310.08576 (2023-10)
Learning to Act from Actionless Videos through Dense Correspondences
2410.10076 (2024-10)
VideoAgent: Self-Improving Video Generation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Earth system forecasting has traditionally relied on complex physical models that are computationally expensive and require significant domain expertise. In the past decade, the unprecedented increase in spatiotemporal Earth observation data has enabled data-driven forecasting models using deep learning techniques. These models have shown promise for diverse Earth system forecasting tasks. However, they either struggle with handling uncertainty or neglect domain-specific prior knowledge; as a result, they tend to suffer from averaging possible futures to blurred forecasts or generating physically implausible predictions. To address these limitations, we propose a two-stage pipeline for probabilistic spatiotemporal forecasting: 1) We develop PreDiff, a conditional latent diffusion model capable of probabilistic forecasts. 2) We incorporate an explicit knowledge alignment mechanism to align forecasts with domain-specific physical constraints. This is achieved by estimating the deviation from imposed constraints at each denoising step and adjusting the transition distribution accordingly. We conduct empirical studies on two datasets: N -body MNIST, a synthetic dataset with chaotic behavior, and SEVIR, a real-world precipitation nowcasting dataset. Specifically, we impose the law of conservation of energy in N -body MNIST and anticipated precipitation intensity in SEVIR. Experiments demonstrate the effectiveness of PreDiff in handling uncertainty, incorporating domain-specific prior knowledge, and generating forecasts that exhibit high operational utility. * Work conducted during an internship at Amazon. † Work conducted while at Amazon. 37th Conference on Neural Information Processing Systems (NeurIPS 2023).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2307.10422")
get_code_for_paper("2307.10422")
have("2307.10422")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2307.10422.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2307.10422.svg)](https://syntology.ai/paper/2307.10422)

Connect an agent — have() is free.