SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.00373 · 2024

Robust Traffic Forecasting against Spatial Shift over Years

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2410.00373.json · badge: /api/ran/2410.00373.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
dreamzz5/st-expert canonical (classifier label)
classifier basis: census
10 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_normalized_laplacian Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/utils/graph_algo.py
code served (permissive licence) · get_code("52c34de0cec03ed2")
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 csr_matrix. 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 numpy as np
import scipy.sparse as sp

# Create a small adjacency matrix for a graph with 4 nodes
# Using a sparse format that can be converted to COO
adj_mx = sp.csr_matrix(np.array([
    [0, 1, 1, 0],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 1, 1, 0]
], dtype=float))

ARGS = {
    "adj_mx": adj_mx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
calculate_scaled_laplacian Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dreamzz5/st-expert/src/utils/graph_algo.py
code served (permissive licence) · get_code("18e295f45c0f4bfc")
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 csr_matrix. 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 numpy as np
import scipy.sparse as sp

# Create a small adjacency matrix (4x4 for a graph with 4 nodes)
# Using a simple connected graph structure
adj_mx = np.array([
    [0, 1, 1, 0],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 1, 1, 0]
], dtype=np.float32)

ARGS = {
    "adj_mx": adj_mx,
    "lambda_max": None,
    "undirected": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type csr_matrix — a csr_matrix output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a csr_matrix 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
cosine_similarity_torch Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/models/gwnet.py
code served (permissive licence) · get_code("f1ec054ab073083c")
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 2, dtype family float, shape (2, 3) 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 two small tensors with distinct dimensions
# x1: batch_size=2, embedding_dim=4
x1 = torch.randn(2, 4)

# x2: batch_size=3, embedding_dim=4 (distinct batch size for clarity)
x2 = torch.randn(3, 4)

ARGS = {
    "x1": x1,
    "x2": x2,
    "eps": 1e-08,
}
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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
count_parameters Ran
ran, honoured the contract we drafted
dreamzz5/st-expert/src/models/gwnet.py
code served (permissive licence) · get_code("f6b944f50d3f15ae")
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 int, ndim 0, dtype family int, shape () 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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 int, ndim 0, dtype family int, shape () — shape () 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
get_logger Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/utils/logging.py
code served (permissive licence) · get_code("f651f9272fd5a62a")
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 Logger. 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 os
import sys
import logging
import tempfile

# Create a temporary directory for logging
log_dir = tempfile.mkdtemp()
name = "test_logger"
log_filename = "test.log"
level = logging.INFO

ARGS = {
    "log_dir": log_dir,
    "name": name,
    "log_filename": log_filename,
    "level": level
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
load_adj_from_numpy Ran
ran, honoured the contract we drafted
dreamzz5/st-expert/src/utils/dataloader.py
code served (permissive licence) · get_code("8fc93bd2aa59f663")
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 2, dtype family float, shape (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 numpy as np
import tempfile
import os

# Create a temporary numpy file
temp_dir = tempfile.gettempdir()
numpy_file_path = os.path.join(temp_dir, "test_adj.npy")

# Create a small adjacency matrix and save it
adj_matrix = np.array([[0, 1, 1, 0],
                       [1, 0, 1, 1],
                       [1, 1, 0, 1],
                       [0, 1, 1, 0]], dtype=np.float32)
np.save(numpy_file_path, adj_matrix)

ARGS = {
    "numpy_file": numpy_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (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
load_adj_from_pickle Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/utils/dataloader.py
code served (permissive licence) · get_code("2f6a40dda3499eda")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary pickle file with sample data
temp_dir = tempfile.mkdtemp()
pickle_file = os.path.join(temp_dir, "test_data.pkl")

# Create some sample data to pickle (e.g., a simple adjacency matrix or dict)
sample_data = {
    "adjacency_matrix": [[0, 1, 0], [1, 0, 1], [0, 1, 0]],
    "nodes": ["A", "B", "C"]
}

# Write the sample data to a pickle file
with open(pickle_file, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS with the pickle file path
ARGS = {
    "pickle_file": pickle_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_dataset Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/utils/dataloader.py
code served (permissive licence) · get_code("ceeaa3f62ca1ffab")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 os
import torch
import numpy as np
import pandas as pd
import tempfile
import shutil

torch.manual_seed(0)

class MockLogger:
    def info(self, msg):
        pass

# Create temporary directory structure
temp_dir = tempfile.mkdtemp()
years_dir = os.path.join(temp_dir, '2020')
target_dir = os.path.join(temp_dir, '2021')
os.makedirs(years_dir, exist_ok=True)
os.makedirs(target_dir, exist_ok=True)

# Create mock data files
np.random.seed(0)
data_shape = (100, 4, 3)  # time_steps=100, num_nodes=4, features=3
data = np.random.randn(*data_shape).astype('float32')
mean = np.mean(data, axis=0, keepdims=True).astype('float32')
std = np.std(data, axis=0, keepdims=True).astype('float32') + 1e-5

# Save his.npz for years
np.savez(os.path.join(years_dir, 'his.npz'), data=data, mean=mean, std=std)

# Save his.npz for target
np.savez(os.path.join(target_dir, 'his.npz'), data=data, mean=mean, std=std)

# Create idx files for train/val/test
train_idx = np.array([10, 20, 30, 40], dtype=np.int64)
val_idx = np.array([50, 60], dtype=np.int64)
test_idx = np.array([70, 80], dtype=np.int64)

np.save(os.path.join(years_dir, 'idx_train.npy'), train_idx)
np.save(os.path.join(years_dir, 'idx_val.npy'), val_idx)
np.save(os.path.join(years_dir, 'idx_test.npy'), test_idx)

np.save(os.path.join(target_dir, 'idx_train.npy'), train_idx)
np.save(os.path.join(target_dir, 'idx_val.npy'), val_idx)
np.save(os.path.join(target_dir, 'idx_test.npy'), test_idx)

# Create expert_dict.pk
expert_dict = {
    'expert_1': np.array([0, 1, 2]),
    'expert_2': np.array([1, 2, 3])
}
pd.to_pickle(expert_dict, os.path.join(temp_dir, 'expert_dict.pk'))

class MockArgs:
    def __init__(self):
        self.years = '2020'
        self.target = '2021'
        self.input_dim = 3
        self.seq_len = 12
        self.horizon = 6
        self.bs = 2

ARGS = {
    'data_path': temp_dir,
    'args': MockArgs(),
    'logger': MockLogger()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
normalize_adj_mx Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dreamzz5/st-expert/src/utils/graph_algo.py
code served (permissive licence) · get_code("87d67bc818b4257c")
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 list, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np
import scipy.sparse as sp

# Create a small adjacency matrix (4x4 nodes)
# Make it a simple connected graph
adj_mx = np.array([
    [0, 1, 1, 0],
    [1, 0, 1, 1],
    [1, 1, 0, 1],
    [0, 1, 1, 0]
], dtype=np.float32)

ARGS = {
    'adj_mx': adj_mx,
    'adj_type': 'symadj',
    'return_type': 'dense'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 3, dtype family float — a list output has no array shape of its own; none is stated
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
sample_gumbel Ran
ran; our contract draft was wrong, not the code
dreamzz5/st-expert/src/models/gwnet.py
code served (permissive licence) · get_code("18b4fa2c6dfb395a")
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 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

torch.manual_seed(0)

# Create a small logits tensor (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

ARGS = {
    "logits": logits,
    "eps": 1e-20
}
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 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
masked_mae Not yet run
unverified (harvested, no recorded run)
dreamzz5/st-expert/src/utils/metrics.py
code served (permissive licence) · get_code("5e57b87f956e8b5a")
How it ran

no invocation recorded.

masked_mse Not yet run
unverified (harvested, no recorded run)
dreamzz5/st-expert/src/utils/metrics.py
code served (permissive licence) · get_code("3338cb23d09778db")
How it ran

no invocation recorded.

masked_rmse Not yet run
unverified (harvested, no recorded run)
dreamzz5/st-expert/src/utils/metrics.py
code served (permissive licence) · get_code("0c4c7b8670f0202f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 1 later) and 10 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
count_parameters 180 other papers
148 dated earlier, 1 the same month, 25 later, 6 same year, order not determinable · 8 only as an assembly brick
1705.08415 (2017-05)
Supervised Community Detection with Line Graph Neural Networks
1707.01926 (2017-07)
Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting
1808.09367 (2018-08)
Deriving Machine Attention from Human Rationales
and 177 more not named here
get_logger 2 other papers
1 dated earlier, 1 the same month
2310.09751 (2023-10)
UniTime: A Language-Empowered Unified Model for Cross-Domain Time Series Forecasting
2410.10524 (2024-10)
Get Rid of Isolation: A Continuous Multi-task Spatio-Temporal Learning Framework
cosine_similarity_torch 1 other paper
1 dated earlier
2312.11198 (2023-12)
Signed Graph Neural Ordinary Differential Equation for Modeling Continuous-time Dynamics

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-23.

Repositories linked to this paper

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

Abstract

Recent advancements in Spatiotemporal Graph Neural Networks (ST-GNNs) and Transformers have demonstrated promising potential for traffic forecasting by effectively capturing both temporal and spatial correlations. The generalization ability of spatiotemporal models has received considerable attention in recent scholarly discourse. However, no substantive datasets specifically addressing traffic out-of-distribution (OOD) scenarios have been proposed. Existing ST-OOD methods are either constrained to testing on extant data or necessitate manual modifications to the dataset. Consequently, the generalization capacity of current spatiotemporal models in OOD scenarios remains largely underexplored. In this paper, we investigate state-of-the-art models using newly proposed traffic OOD benchmarks and, surprisingly, find that these models experience a significant decline in performance. Through meticulous analysis, we attribute this decline to the models' inability to adapt to previously unobserved spatial relationships. To address this challenge, we propose a novel Mixture of Experts (MoE) framework, which learns a set of graph generators (i.e., graphons) during training and adaptively combines them to generate new graphs based on novel environmental conditions to handle spatial distribution shifts during testing. We further extend this concept to the Transformer architecture, achieving substantial improvements. Our method is both parsimonious and efficacious, and can be seamlessly integrated into any spatiotemporal model, outperforming current state-of-the-art approaches in addressing spatial dynamics.

For agents

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

get_harvested_code_for_paper("2410.00373")
get_code_for_paper("2410.00373")
have("2410.00373")

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

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

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

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

Connect an agent — have() is free.