SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.24054 · 2026

Hierarchical Spatial-Temporal Graph-Enhanced Model for Map-Matching

Shunyu Yao, Zhenglin Wan, Pingfu Chao, Anjun Gao

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2603.24054.json · badge: /api/ran/2603.24054.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
Nerooo-g/HSTGMatch community
Papers with Code archive
7 ran · 2 no recorded run
FunctionStatusWhere it lives
GridGraphEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("b6dba0afeea20d5a")
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, GridGraphEncoder: 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 test graph: 3 nodes, 4 directed edges
n_grids = 3
d_model = 4
n_layers = 2
n_heads = 2
dropout = 0.1

# Create edge_index: (2, E) tensor
# Edges: 0->1, 1->2, 2->0, 0->2
edge_index = torch.tensor([
    [0, 1, 2, 0],
    [1, 2, 0, 2]
], dtype=torch.long)

# Create edge_weights: (E,) tensor - visit frequencies/gamma values
edge_weights = torch.tensor([0.5, 0.3, 0.4, 0.2], dtype=torch.float)

# node_ids: Optional, so we can test with None or explicit tensor
node_ids = None  # Will default to arange(n_grids) inside forward

ARGS = {
    'n_grids': n_grids,
    'd_model': d_model,
    'n_layers': n_layers,
    'n_heads': n_heads,
    'dropout': dropout
}
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 GridGraphEncoder — 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 GridGraphEncoder 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
IntervalEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("2ab6da1a97fd88b9")
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, IntervalEmbedding: 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 arguments for IntervalEmbedding
ARGS = {
    'n_slots': 8,
    'd_model': 4,
    'max_value': 10.0
}

# Verify the module can be instantiated with these args
if __name__ == "__main__":
    module = nn.IntervalEmbedding(**ARGS)
    
    # Create sample inputs for testing
    batch_size = 2
    seq_length = 3
    
    v_r = torch.randn(batch_size, seq_length) * ARGS['max_value']
    positions = torch.randint(1, seq_length + 1, (batch_size, seq_length))
    
    # Test forward pass
    output = module(v_r, positions)
    print(f"Output shape: {output.shape}")
    assert output.shape == (batch_size, seq_length, 2 * ARGS['d_model']), \
        f"Expected shape {(batch_size, seq_length, 2 * ARGS['d_model'])}, got {output.shape}"
    print("Module works correctly!")
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 IntervalEmbedding — 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 IntervalEmbedding 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
OptGATLayer Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("d67f9039cc968064")
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, OptGATLayer: 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
import math

torch.manual_seed(0)

# Define the arguments for OptGATLayer
in_dim = 4
out_dim = 8
n_heads = 2
dropout = 0.1

# Create sample input tensors
N = 2  # Number of nodes
E = 3  # Number of edges

# Node features: (N, in_dim)
x = torch.randn(N, in_dim)

# Edge index: (2, E) — [src; dst]
edge_index = torch.tensor([
    [0, 1, 0],  # source nodes
    [1, 0, 1]   # destination nodes
], dtype=torch.long)

# Edge weights (gamma values): (E,)
edge_weights = torch.rand(E)

ARGS = {
    "in_dim": in_dim,
    "out_dim": out_dim,
    "n_heads": n_heads,
    "dropout": dropout,
}
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 OptGATLayer — 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 OptGATLayer 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
SinusoidalPositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("5df6c4b1c1d2f156")
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, SinusoidalPositionalEncoding: 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
import math

torch.manual_seed(0)

# The SinusoidalPositionalEncoding constructor takes:
# - d_model: int (dimension of the model)
# - max_len: int (maximum sequence length, default 512)
# - dropout: float (dropout probability, default 0.1)

ARGS = {
    'd_model': 8,
    'max_len': 64,
    'dropout': 0.1
}
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 SinusoidalPositionalEncoding — 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 SinusoidalPositionalEncoding 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
SpatialTemporalEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("9e1a95a2d784d4c7")
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, SpatialTemporalEmbedding: 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)

# Set up parameters for SpatialTemporalEmbedding
n_distance_slots = 8
n_time_slots = 6
d_model = 4
max_distance = 1000.0
max_time = 3600.0

ARGS = {
    "n_distance_slots": n_distance_slots,
    "n_time_slots": n_time_slots,
    "d_model": d_model,
    "max_distance": max_distance,
    "max_time": max_time,
}
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 SpatialTemporalEmbedding — 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 SpatialTemporalEmbedding 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
TransformerDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("437d65d5abc84d73")
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, TransformerDecoder: 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
import math

torch.manual_seed(0)

# Define the ARGS dictionary with all required parameters for TransformerDecoder
ARGS = {
    "n_segments": 10,
    "d_model": 128,
    "n_heads": 8,
    "n_layers": 4,
    "d_ff": 512,
    "dropout": 0.1,
    "max_len": 512,
}
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 TransformerDecoder — 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 TransformerDecoder 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
TransformerEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("ed600bb7db3cba11")
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, TransformerEncoder: 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 ARGS dict mapping all parameters of TransformerEncoder.__init__
ARGS = {
    'input_dim': 16,
    'd_model': 128,
    'n_heads': 8,
    'n_layers': 4,
    'd_ff': 512,
    'dropout': 0.1,
    'max_len': 512,
}
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 TransformerEncoder — 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 TransformerEncoder 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
HSTGMatch Not yet run
unverified (harvested, no recorded run)
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("54aaf7d5f64b7b35")
How it ran

no invocation recorded.

HSTGMatchPretrainer Not yet run
unverified (harvested, no recorded run)
Nerooo-g/HSTGMatch/src/models/hstgmatch.py
code served (permissive licence) · get_code("b242259ff1a0612c")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

The integration of GNSS data into portable devices has led to the generation of vast amounts of trajectory data, which is crucial for applications such as map-matching. To tackle the limitations of rulebased methods, recent works in deep learning for trajectory-related tasks occur. However, existing models remain challenging due to issues such as the difficulty of large-scale data labeling, ineffective modeling of spatialtemporal relationships, and discrepancies between training and test data distributions. To tackle these challenges, we propose HSTGMatch, a novel model designed to enhance map-matching performance. Our approach involves a two-stage process: hierarchical self-supervised learning and spatial-temporal supervised learning. We introduce a hierarchical trajectory representation, leveraging both grid cells and geographic tuples to capture moving patterns effectively. The model constructs an Adaptive Trajectory Adjacency Graph to dynamically capture spatial relationships, optimizing GATs for improved efficiency. Furthermore, we incorporate a Spatial-Temporal Factor to extract relevant features and employ a decay coefficient to address variations in trajectory length. Our extensive experiments demonstrate the model's superior performance, module effectiveness, and robustness, providing a promising solution for overcoming the existing limitations in map-matching applications. The source code of HSTGMatch is publicly available on GitHub at https://github.com/Nerooo-g/HSTGMatch.

For agents

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

get_harvested_code_for_paper("2603.24054")
get_code_for_paper("2603.24054")
have("2603.24054")

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

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

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

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

Connect an agent — have() is free.