SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.03784 · ICLR · 2024

AirPhyNet: Harnessing Physics-Guided Neural Networks for Air Quality Prediction

Kethmi Hettige, Jiahao Ji, Shili Xiang, Cheng Long, Gao Cong, Jingyuan Wang

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 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/2402.03784.json · badge: /api/ran/2402.03784.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
kethmih/airphynet community
Papers with Code archive
5 ran · 3 no recorded run
FunctionStatusWhere it lives
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("bb82ba0e85d3728c")
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 an instance of its own class, Decoder: the run constructed the object and did not call it, so no result was computed. 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)

# Analyze the forward method:
# - inputs is expected to have 4 dimensions
# - inputs is reshaped using self.num_nodes and a latent_dim
# - self.output_dim is used in final reshape
# - adj_mx is not used in forward (but stored in __init__)

# The forward expects inputs shape: (horizon, n_traj_samples, batch_size, num_nodes * latent_dim)
# After reshape: (horizon, n_traj_samples, batch_size, num_nodes, latent_dim)
# After transpose: (horizon, n_traj_samples, batch_size, latent_dim, num_nodes)

# Let's use:
# horizon=2, n_traj_samples=3, batch_size=2, num_nodes=4, latent_dim=5
# So input last dim should be num_nodes * latent_dim = 4 * 5 = 20

horizon = 2
n_traj_samples = 3
batch_size = 2
num_nodes = 4
latent_dim = 5
output_dim = 6

# Create adjacency matrix (not used in forward but required in __init__)
adj_mx = torch.eye(num_nodes)

# Create input tensor with shape (horizon, n_traj_samples, batch_size, num_nodes * latent_dim)
inputs = torch.randn(horizon, n_traj_samples, batch_size, num_nodes * latent_dim)

ARGS = {
    'output_dim': output_dim,
    'adj_mx': adj_mx,
    'num_nodes': num_nodes,
    'num_edges': 8,
}
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 Decoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Decoder 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
DiffeqSolver Ran
ran on a synthesized input · constructed an object; no result was computed
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("41585b9a13b2f370")
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 an instance of its own class, DiffeqSolver: the run constructed the object and did not call it, so no result was computed. 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
from torchdiffeq import odeint

torch.manual_seed(0)

# Define a minimal ODE function that satisfies the usage in DiffeqSolver
class SimpleODEFunc(nn.Module):
    def __init__(self, latent_dim):
        super().__init__()
        self.latent_dim = latent_dim
        self.nfe = 0
        self.linear = nn.Linear(latent_dim, latent_dim)
    
    def forward(self, t, y):
        # y shape: (n_traj_samples * batch_size, latent_dim)
        self.nfe += 1
        return self.linear(y)

# Create the ODE function
latent_dim = 4
odefunc = SimpleODEFunc(latent_dim)

# Create time steps for prediction (horizon of 5 time steps)
time_steps_to_pred = torch.linspace(0, 1, 5)

# Create first point: (n_traj_samples=2, batch_size=3, latent_dim=4)
first_point = torch.randn(2, 3, latent_dim)

ARGS = {
    "odefunc": odefunc,
    "method": "dopri",
    "latent_dim": latent_dim,
    "odeint_rtol": 0.0001,
    "odeint_atol": 1e-05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchdiffeq — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DiffeqSolver — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DiffeqSolver 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
EncoderAttrs Ran
ran on a synthesized input · constructed an object; no result was computed
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("0ffa6a7ccc25f9b5")
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 an instance of its own class, EncoderAttrs: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

# Create a small adjacency matrix
# Shape: (num_nodes, num_nodes) with some non-zero entries
adj_mx = np.array([
    [0.0, 1.5, 0.0, 0.0],
    [1.5, 0.0, 2.0, 0.0],
    [0.0, 2.0, 0.0, 1.2],
    [0.0, 0.0, 1.2, 0.0]
], dtype=np.float32)

ARGS = {
    'adj_mx': adj_mx,
    'gcn_step': 2,
    'filter_type': 'laplacian',
    'num_rnn_layers': 1,
    'rnn_units': 64,
    'latent_dim': 4
}
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 EncoderAttrs — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a EncoderAttrs 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
GatedFusionModel Ran
ran on a synthesized input · constructed an object; no result was computed
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("080303713985a4c6")
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 an instance of its own class, GatedFusionModel: the run constructed the object and did not call it, so no result was computed. 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)

class GatedFusionModel(torch.nn.Module):

    def __init__(self, num_nodes, latent_dim):
        super(GatedFusionModel, self).__init__()
        self._num_nodes = num_nodes
        self._latent_dim = latent_dim
        self.hid_dim = self._num_nodes * self._latent_dim
        self.fc = nn.Linear(self.hid_dim, self.hid_dim)
        self.sigmoid = torch.nn.Sigmoid()

    def forward(self, grad_diff, grad_adv):
        X_diff = self.fc(grad_diff)
        X_adv = self.fc(grad_adv)
        z = self.sigmoid(torch.add(X_diff, X_adv))
        H = torch.add(z * X_diff, (1 - z) * X_adv)
        return H


num_nodes = 4
latent_dim = 3
model = GatedFusionModel(num_nodes=num_nodes, latent_dim=latent_dim)

grad_diff = torch.randn(2, num_nodes * latent_dim)
grad_adv = torch.randn(2, num_nodes * latent_dim)

ARGS = {
    'num_nodes': num_nodes,
    'latent_dim': latent_dim
}
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 GatedFusionModel — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GatedFusionModel 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
LinearNet Ran
ran on a synthesized input · constructed an object; no result was computed
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("99dd0729ec83dfae")
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 an instance of its own class, LinearNet: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {}
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 LinearNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LinearNet 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
AirPhyNetModel Not yet run
unverified (harvested, no recorded run)
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("4af1588c1a5c6e77")
How it ran

no invocation recorded.

Encoder_z0_RNN Not yet run
unverified (harvested, no recorded run)
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("38a44df4ada46dd3")
How it ran

no invocation recorded.

ODEFunc Not yet run
unverified (harvested, no recorded run)
kethmih/airphynet/airphynet_model.py
code served (permissive licence) · get_code("f23d570660ddaa65")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
DiffeqSolver
brick of this paper's assembly: model
1 other paper
1 dated earlier
2209.00225 (2022-09)
STDEN: Towards Physics-Guided Neural Networks for Traffic Flow Prediction

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

Air quality prediction and modelling plays a pivotal role in public health and environment management, for individuals and authorities to make informed decisions. Although traditional data-driven models have shown promise in this domain, their long-term prediction accuracy can be limited, especially in scenarios with sparse or incomplete data and they often rely on black-box deep learning structures that lack solid physical foundation leading to reduced transparency and interpretability in predictions. To address these limitations, this paper presents a novel approach named Physics guided Neural Network for Air Quality Prediction (AirPhyNet). Specifically, we leverage two well-established physics principles of air particle movement (diffusion and advection) by representing them as differential equation networks. Then, we utilize a graph structure to integrate physics knowledge into a neural network architecture and exploit latent representations to capture spatio-temporal relationships within the air quality data. Experiments on two real-world benchmark datasets demonstrate that AirPhyNet outperforms state-of-the-art models for different testing scenarios including different lead time (24h, 48h, 72h), sparse data and sudden change prediction, achieving reduction in prediction errors up to 10%. Moreover, a case study further validates that our model captures underlying physical processes of particle movement and generates accurate predictions with real physical meaning.

For agents

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

get_harvested_code_for_paper("2402.03784")
get_code_for_paper("2402.03784")
have("2402.03784")

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

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

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

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

Connect an agent — have() is free.