SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.10380 · ICLR · 2022

Learning to Remember Patterns: Pattern Matching Memory Networks for Traffic Forecasting

Hyunwook Lee, Seungmin Jin, Hyeshin Chu, Hongkyu Lim, Sungahn Ko

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 4 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2110.10380.json · badge: /api/ran/2110.10380.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
hyunwookl/pm-memnet canonical (classifier label)
classifier basis: classifier_2025
4 ran · 2 no recorded run
HyunWookL/PM-MemNet canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
count_parameters Ran
ran, honoured the contract we drafted
HyunWookL/PM-MemNet/model/PMMemNet.py
code served (permissive licence) · get_code("506a63e8992f7432")
How it ran

Ran in Syntology's jail 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. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:44:59Z). 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)

# Build a small model with some parameters
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
numpy, 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
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("7a49d4abe5662ef3")
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)

# Define the gconv class (from the function signature)
class gconv(nn.Module):
    def __init__(self, order=2, hidden_size=64, support_len=3):
        super(gconv, self).__init__()
        self.order = order
        self.support_len = support_len
        self.linear = nn.Linear(hidden_size * (order * support_len + 1), hidden_size)

    def forward(self, x, supports, score):
        x0 = x
        out = [x0]
        for adj in supports:
            x1 = torch.matmul(adj, x0)
            out.append(torch.matmul(score, x1))
            for i in range(1, self.order):
                x2 = torch.matmul(adj, x1)
                out.append(torch.matmul(score, x2))
                x1 = x2
        out = self.linear(torch.cat(out, dim=-1))
        return out

# Small parameters for testing
num_nodes = 3
key_size = 5
embedding_dim = 4
sequence_length = 2
hops = 2
output_dim = 1

ARGS = {
    'num_nodes': num_nodes,
    'key_size': key_size,
    'embedding_dim': embedding_dim,
    'sequence_length': sequence_length,
    'hops': hops,
    'output_dim': output_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 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
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("6e6df2f3f56776c5")
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, Encoder: 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)

# Small dimensions for testing
B = 2  # batch size
N = 4  # num_nodes
T = 18  # sequence_length
C = 2  # channels
H = 8  # embedding_dim
K = 3  # key_size
L = 2  # hops (note: we'll use 2 instead of 3 to keep it small)
t_classes = 288

# Create input tensor (B, N, T, C)
x = torch.randn(B, N, T, C)

# Create support adjacency matrices (list of 2: inflow, outflow)
supports = [torch.randn(N, N) for _ in range(2)]
supports = [torch.softmax(torch.relu(s), dim=-1) for s in supports]

# Create topk_results: (matched_idx, k_score)
# matched_idx should be shape (B, N, K) with indices
matched_idx = torch.randint(0, K, (B, N, K))
# k_score should be shape (B, N, K) with scores
k_score = torch.randn(B, N, K)

topk_results = (matched_idx, k_score)

ARGS = {
    'num_nodes': N,
    'key_size': K,
    'embedding_dim': H,
    'hops': L,
    'sequence_length': T,
    't_classes': t_classes,
}
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 Encoder — 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 Encoder 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
count_parameters Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from crisbodnar/ndp
pointer only · get_code("f6b944f50d3f15ae")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

fourier Ran
ran; our contract draft was wrong, not the code
HyunWookL/PM-MemNet/model/PMMemNet.py
code served (permissive licence) · get_code("8014c8277fdd9f56")
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 4, dtype family float, shape (2, 4, 3, 2) 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
import torch.nn.functional as F
import numpy as np

torch.manual_seed(0)

# Create a small query tensor with shape (B, N, T)
# B=2 (batch), N=4 (features/channels), T=3 (time steps)
query = torch.randn(2, 4, 3)

ARGS = {
    "query": query
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 4, 3, 2) — shape (2, 4, 3, 2) 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
fourier Ran
ran; our contract draft was wrong, not the code
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("75b069b2a552c0b6")
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 4, dtype family float, shape (2, 4, 3, 2) 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 query tensor with shape (B, N, T)
# B=2 (batch), N=4 (features/channels), T=3 (time steps)
query = torch.randn(2, 4, 3)

ARGS = {
    "query": query
}
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 2) — shape (2, 4, 3, 2) 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_nearest_key Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HyunWookL/PM-MemNet/model/PMMemNet.py
code served (permissive licence) · get_code("da1777082c154632")
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 tuple, ndim 4, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Parameters for get_nearest_key
B = 2  # batch size
N = 3  # number of positions/time steps
T = 4  # time dimension (will be doubled to 2*T in fourier)
K = 5  # number of keys in dictionary
k = 2  # k for k-NN

# query: (B, N, 2*T) - fourier transform of historical speed
query = torch.randn(B, N, 2 * T)

# key_dict: (K, 2*T) - fourier transform of representative patterns
key_dict = torch.randn(K, 2 * T)

# sim: similarity function type
sim = 'cosine'

ARGS = {
    'query': query,
    'key_dict': key_dict,
    'k': k,
    'sim': sim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
get_nearest_key Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("5f4e9bd8c7711392")
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 tuple, ndim 4, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define parameters
B = 2  # batch size
N = 3  # number of segments
T = 4  # time dimension (fourier features will be 2*T)
K = 5  # number of keys in dictionary
k = 2  # k for k-NN

# Create query tensor: (B, N, 2*T)
query = torch.randn(B, N, 2 * T)

# Create key_dict tensor: (K, 2*T)
key_dict = torch.randn(K, 2 * T)

# Define ARGS dictionary
ARGS = {
    'query': query,
    'key_dict': key_dict,
    'k': k,
    'sim': 'cosine'
}
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 tuple, ndim 4, 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
PMMemNet Not yet run
unverified (harvested, no recorded run)
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("bdc5b4d4d49862c9")
How it ran

no invocation recorded.

gconv Not yet run
unverified (harvested, no recorded run)
hyunwookl/pm-memnet/model/PMMemNet.py
code served (permissive licence) · get_code("a2aea6636f88e641")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 6 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
47 dated earlier, 3 the same month, 130 later · 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

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

Traffic forecasting is a challenging problem due to complex road networks and sudden speed changes caused by various events on roads. Several models have been proposed to solve this challenging problem, with a focus on learning the spatio-temporal dependencies of roads. In this work, we propose a new perspective for converting the forecasting problem into a pattern-matching task, assuming that large traffic data can be represented by a set of patterns. To evaluate the validity of this new perspective, we design a novel traffic forecasting model called Pattern-Matching Memory Networks (PM-MemNet), which learns to match input data to representative patterns with a key-value memory structure. We first extract and cluster representative traffic patterns that serve as keys in the memory. Then, by matching the extracted keys and inputs, PM-MemNet acquires the necessary information on existing traffic patterns from the memory and uses it for forecasting. To model the spatio-temporal correlation of traffic, we proposed a novel memory architecture, GCMem, which integrates attention and graph convolution. The experimental results indicate that PM-MemNet is more accurate than state-of-the-art models, such as Graph WaveNet, with higher responsiveness. We also present a qualitative analysis describing how PM-MemNet works and achieves higher accuracy when road speed changes rapidly.

For agents

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

get_harvested_code_for_paper("2110.10380")
get_code_for_paper("2110.10380")
have("2110.10380")

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

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

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

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

Connect an agent — have() is free.