SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.15658 · NeurIPS · 2024

TorchSpatial: A Location Encoding Framework and Benchmark for Spatial Representation Learning

Stefano Ermon, Gengchen Mai, Ni Lao, Akshay Nambi, Tanuja Ganu, Zhangyu Wang, Nemin Wu, Qian Cao, Zeping Liu, Yanlin Qi, Jielu Zhang, Joshua Ni, and 3 more

arXiv · PDF · Open in the Atlas

Code that ran

21 of 22 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, 1 violated it and 0 have no contract verdict; 17 failures of our instrument; 1 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/2406.15658.json · badge: /api/ran/2406.15658.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
seai-lab/torchspatial canonical (classifier label)
classifier basis: census
16 ran · 1 no recorded run
seai-lab/pygbs canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
seai-lab/TorchSpatial canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
auto_density Ran
ran, honoured the contract we drafted
seai-lab/pygbs/baselines/gbsloss.py
code served (permissive licence) · get_code("757cdfd8757676b2")
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 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 numpy as np

# The function auto_density takes:
# - radius: a numeric value (float or int) representing a radius
# - n_neighbors: an integer representing number of neighbors

# Based on the function body:
# - radius is used in arithmetic (squared, multiplied)
# - n_neighbors is used in arithmetic (divided)
# Both are numeric scalars

ARGS = {
    "radius": 0.5,
    "n_neighbors": 10,
}
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 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
bce_loss Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/losses.py
code served (permissive licence) · get_code("ee66019898426cda")
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)

# The function bce_loss takes a single parameter 'pred' which is used with:
# - torch.log() operation
# - Addition with scalar 1e-05
# - Negation with minus operator
# This means pred should be a tensor with numerical values

pred = torch.rand(2, 4)  # Small batch of 2, dimension 4

ARGS = {
    "pred": pred
}
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
compute_kl_sri Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seai-lab/pygbs/gbs/sri/sri_scores.py
code served (permissive licence) · get_code("ce1886c7a705a294")
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 2, 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

# Construct small, valid test data
np.random.seed(0)

# global_values: 1D array of values to compute histogram over
global_values = np.random.randn(50).astype(np.float64)

# local_values_list: list of 1D arrays, each representing local values
# Mix some that pass threshold (>= 20) and some that don't (< 20)
local_values_1 = np.random.randn(25).astype(np.float64)  # passes threshold
local_values_2 = np.random.randn(30).astype(np.float64)  # passes threshold
local_values_3 = np.random.randn(5).astype(np.float64)   # fails threshold (< 20)

local_values_list = [local_values_1, local_values_2, local_values_3]

# Define the ARGS dictionary with all parameters
ARGS = {
    "local_values_list": local_values_list,
    "global_values": global_values,
    "bins": 10,
    "threshold": 20,
    "smooth": 1e-08
}
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 tuple, ndim 2, 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
compute_mrr_by_lat Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seai-lab/torchspatial/main/eval_analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from gengchenmai/sphere2vec, is pointer only (licence: NONE) · get_code("eccb2504e6bf75c5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gengchenmai/sphere2vec, and GitHub detected no licence in that repository when it was checked. 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.

compute_mrr_by_latlongrid Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/eval_analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from gengchenmai/sphere2vec, is pointer only (licence: NONE) · get_code("f0c8a19e7f1331fe")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gengchenmai/sphere2vec, and GitHub detected no licence in that repository when it was checked. 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.

compute_neighbor_prior Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/baselines.py
code served (permissive licence) · get_code("48bee5af4d1cdfec")
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 (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 numpy as np
from sklearn.neighbors import BallTree

np.random.seed(0)

# Create training data with class labels
num_train_samples = 10
num_classes = 3

# train_classes: array of class IDs for training samples
train_classes = np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0])

# Create synthetic training locations (2D coordinates)
train_locations = np.random.rand(num_train_samples, 2) * 10

# Build a BallTree for nearest neighbor queries
nn_tree = BallTree(train_locations, leaf_size=40)

# eval_loc: evaluation location as (lat, lon) or similar 2D coordinate
eval_loc = np.array([5.0, 5.0])

# hyper_params: dictionary with either 'dist_thresh' or 'num_neighbors'
hyper_params_distance = {
    'dist_thresh': 2.5
}

hyper_params_knn = {
    'num_neighbors': 3
}

# ptype: either 'distance' or 'knn'
ptype_distance = 'distance'
ptype_knn = 'knn'

ARGS = {
    'train_classes': train_classes,
    'num_classes': num_classes,
    'eval_loc': eval_loc,
    'nn_tree': nn_tree,
    'hyper_params': hyper_params_knn,
    'ptype': ptype_knn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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 (3,) — shape (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
construct_weight_matrix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seai-lab/pygbs/baselines/gbsloss.py
code served (permissive licence) · get_code("824c3511b683ed83")
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 (5, 5) 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
from sklearn.neighbors import BallTree
from scipy import sparse

# Set random seed for reproducibility
np.random.seed(0)

# Create small spherical coordinate points in radians
# Shape: (5, 2) - 5 points with 2 spherical coordinates (latitude, longitude)
points = np.array([
    [0.1, 0.2],
    [0.15, 0.25],
    [0.12, 0.22],
    [0.18, 0.28],
    [0.11, 0.21]
], dtype=np.float64)

# Number of nearest neighbors
k = 2

ARGS = {
    "points": points,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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 (5, 5) — shape (5, 5) 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
create_kde_grid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seai-lab/torchspatial/main/baselines.py
code served (permissive licence) · get_code("ec0ef856ad8a26b0")
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. 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

# Create small training data
train_classes = np.array([0, 1, 0, 1, 2, 0], dtype=int)
train_locs = np.array([
    [1.2, 2.3],
    [5.1, 6.7],
    [1.5, 2.1],
    [5.3, 6.9],
    [10.2, 11.1],
    [1.1, 2.2]
], dtype=float)

hyper_params = {
    'kde_quant': 2.0
}

ARGS = {
    'train_classes': train_classes,
    'train_locs': train_locs,
    'hyper_params': hyper_params
}
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 tuple — a tuple output has no array shape of its own; none is 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
embed_l2_normalize Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/losses.py
pointer only (licence: MIT); the stored copy get_code serves, from gengchenmai/csp, is pointer only (licence: NONE) · get_code("96cda1aea7b63917")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gengchenmai/csp, and GitHub detected no licence in that repository when it was checked. 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.

generate_background_points Ran
ran; our contract draft was wrong, not the code
seai-lab/pygbs/baselines/gbsloss.py
code served (permissive licence) · get_code("b84f15b1635ddbda")
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 (7, 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 numpy as np

# Set random seeds for reproducibility
np.random.seed(0)

# Define arguments for generate_background_points
center = np.array([0.5, 1.2])  # (latitude, longitude) in radians
radius = 0.3  # range of circular grid in radians, must be in (0, pi/2)
density = 10.0  # density of grid points per unit square radian

ARGS = {
    "center": center,
    "radius": radius,
    "density": density,
    "n_points": None
}
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 ndarray, ndim 2, dtype family float, shape (7, 2) — shape (7, 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_activation_function Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/module.py
code served (permissive licence) · get_code("063ddd72ea995d8a")
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 ReLU. 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)

# The function takes two parameters: activation (a string) and context_str (a string)
# It doesn't actually use context_str except in the error message
# So we just need valid string arguments

ARGS = {
    'activation': 'relu',
    'context_str': 'test_context'
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
get_label_rank Ran
ran, violated the contract we drafted
seai-lab/TorchSpatial/main/run_evaluation.py
code served (permissive licence) · get_code("d456c5cf4caf5297")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, shape (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 numpy as np

np.random.seed(0)

batch_size = 2
num_classes = 5

# Create prediction probabilities (should sum to ~1 per row for realistic probabilities)
loc_pred = np.random.rand(batch_size, num_classes)
loc_pred = loc_pred / loc_pred.sum(axis=1, keepdims=True)

# Create ground truth classes (integers in range [0, num_classes))
loc_class = np.array([1, 3])

ARGS = {
    'loc_pred': loc_pred,
    'loc_class': loc_class
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 1, dtype family int, shape (2,) — shape (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_train_sample_ratio_tag Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/data_utils.py
code served (permissive licence) · get_code("fb680a92900a2a60")
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 str. 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

# Construct arguments for get_train_sample_ratio_tag
ARGS = {
    'train_sample_ratio': 0.75,
    'train_sample_method': 'stratified-fix'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
hashable_loc Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/baselines.py
code served (permissive licence) · get_code("28855eb94bf07f6e")
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 int; 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

# Analyze the function:
# - hashable_loc takes two parameters: loc and q
# - loc is indexed with [0] and [1], so it's a sequence-like with at least 2 elements
# - q is used as a divisor in division operations
# - The function returns a tuple of two integers

# loc should be a sequence (list, tuple, or numpy array) with at least 2 numeric elements
loc = np.array([10.5, 25.3])

# q should be a numeric value used as divisor
q = 5

ARGS = {
    "loc": loc,
    "q": q
}
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 tuple, ndim 1, dtype family int — 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
load_bird_data Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/datasets.py
code served (permissive licence) · get_code("65b7b5e57148522e")
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. 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 json
import numpy as np
import tempfile

# Create a temporary directory for test data
temp_dir = tempfile.mkdtemp()

# Create sample bird data JSON file
sample_data = {
    "train": [
        {
            "valid_image": True,
            "im_path": "bird_001.jpg",
            "class_id": 5,
            "orig_meta": {
                "user_id": 101,
                "lon": -120.5,
                "lat": 38.2,
                "date": 1234567890.0
            },
            "ebird_meta": {
                "user_id": 102,
                "lon": -120.6,
                "lat": 38.3,
                "date": 1234567891.0
            }
        },
        {
            "valid_image": True,
            "im_path": "bird_002.jpg",
            "class_id": 12,
            "orig_meta": {
                "user_id": 103,
                "lon": -121.5,
                "lat": 39.2,
                "date": 1234567892.0
            },
            "ebird_meta": {
                "user_id": 104,
                "lon": -121.6,
                "lat": 39.3,
                "date": 1234567893.0
            }
        },
        {
            "valid_image": False,
            "im_path": "bird_003.jpg",
            "class_id": 8,
            "orig_meta": {
                "user_id": None,
                "lon": float('nan'),
                "lat": 40.2,
                "date": float('nan')
            },
            "ebird_meta": {
                "user_id": None,
                "lon": float('nan'),
                "lat": 40.3,
                "date": float('nan')
            }
        }
    ],
    "valid": [
        {
            "valid_image": True,
            "im_path": "bird_val_001.jpg",
            "class_id": 7,
            "orig_meta": {
                "user_id": 201,
                "lon": -122.5,
                "lat": 37.2,
                "date": 1234567900.0
            },
            "ebird_meta": {
                "user_id": 202,
                "lon": -122.6,
                "lat": 37.3,
                "date": 1234567901.0
            }
        }
    ],
    "test": [
        {
            "valid_image": True,
            "im_path": "bird_test_001.jpg",
            "class_id": 3,
            "orig_meta": {
                "user_id": 301,
                "lon": -123.5,
                "lat": 36.2,
                "date": 1234567910.0
            },
            "ebird_meta": {
                "user_id": 302,
                "lon": -123.6,
                "lat": 36.3,
                "date": 1234567911.0
            }
        }
    ]
}

# Write JSON file
ann_file_path = os.path.join(temp_dir, "bird_data.json")
with open(ann_file_path, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    'ip_dir': temp_dir + '/',
    'ann_file_name': 'bird_data.json',
    'split_name': 'train',
    'remove_empty': False,
    'meta_type': 'orig_meta'
}
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 tuple — a tuple output has no array shape of its own; none is 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_mask Ran
ran, honoured the contract we drafted
seai-lab/torchspatial/main/analysis.py
code served (permissive licence) · get_code("9d835b2cb9e2f146")
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 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 tempfile
import os

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a simple test mask array (2D array simulating an ocean mask)
# Using a small 5x5 array with some variation to create gradients
test_mask = np.array([
    [1.0, 1.0, 0.0, 0.0, 0.0],
    [1.0, 1.0, 0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0, 1.0, 1.0],
    [0.0, 0.0, 0.0, 1.0, 1.0],
    [0.0, 0.0, 0.0, 0.0, 0.0]
], dtype=np.float32)

# Save the test mask
mask_path = os.path.join(temp_dir, 'ocean_mask.npy')
np.save(mask_path, test_mask)

# Define ARGS dict with all parameters for load_mask
ARGS = {
    'mask_dir': temp_dir + '/',
    'mask_filename': 'ocean_mask.npy'
}
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 tuple, ndim 3, 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
load_sparse_feats Ran
ran, honoured the contract we drafted
seai-lab/torchspatial/main/datasets.py
code served (permissive licence) · get_code("3cfd8e042f3a9170")
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 (3, 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 numpy as np
from scipy import sparse
import tempfile
import os

# Create a temporary sparse matrix and save it as .npz
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_feats.npz")

# Create a small sparse matrix
sparse_matrix = sparse.csr_matrix(
    np.array([[0.1, 0.0, 0.5],
              [0.0, 0.8, 0.0],
              [0.3, 0.0, 0.9]], dtype=np.float32)
)
sparse.save_npz(temp_file, sparse_matrix)

ARGS = {
    "file_path": temp_file,
    "invert": False
}
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 ndarray, ndim 2, dtype family float, shape (3, 3) — shape (3, 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
make_baseline_model_file Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/analysis.py
code served (permissive licence) · get_code("05bbcdadb7f81960")
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 str. 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 minimal eval_params dict
eval_params = {
    'algs': [],  # Will be set by the function
    'dataset': 'birdsnap',  # One of the datasets that triggers meta_str
    'meta_type': 'species',  # Meta type for birdsnap/nabirds
    'spa_enc': 'resnet50',  # Spatial encoder type
    'trained_models_root': '/tmp/models/',  # Root directory for model files
}

ARGS = {
    'eval_params': eval_params
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
make_model_res_file Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/data_utils.py
code served (permissive licence) · get_code("d54c93139380fbe0")
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 str. 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
import tempfile
import os

# Create a temporary directory for data_dir
temp_dir = tempfile.mkdtemp()

ARGS = {
    'data_dir': temp_dir,
    'dataset': 'inat2018',
    'eval_split': 'val',
    'res_type': 'preds',
    'sample_ratio': None
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
make_sphere_model_file Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/analysis.py
code served (permissive licence) · get_code("89fc1fad0c9b5226")
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 str. 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)

# Construct params dict with all required keys based on function usage
params = {
    'lr': 0.001,
    'frequency_num': 10,
    'min_radius': 0.0000001,
    'num_hidden_layer': 2,
    'hidden_dim': 64
}

# Construct eval_params dict with all required keys based on function usage
eval_params = {
    'dataset': 'birdsnap',
    'meta_type': 'taxonomy',
    'spa_enc': 'spherical',
    'trained_models_root': '/tmp/models/'
}

ARGS = {
    'params': params,
    'eval_params': eval_params
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
plot_locs Ran
ran; our contract draft was wrong, not the code
seai-lab/torchspatial/main/eval_analysis.py
pointer only (licence: MIT); the stored copy get_code serves, from gengchenmai/sphere2vec, is pointer only (licence: NONE) · get_code("b6dbb6a8dbe80516")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gengchenmai/sphere2vec, and GitHub detected no licence in that repository when it was checked. 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.

get_classes_sample_idxs Not yet run
unverified (harvested, no recorded run)
seai-lab/torchspatial/main/data_utils.py
code served (permissive licence) · get_code("774c7aa6fadacf26")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 18 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
compute_mrr_by_lat 2 other papers
2 dated earlier
2201.10489 (2022-01)
Sphere2Vec: Multi-Scale Representation Learning over a Spherical Surface for Geospatial Predictions
2306.17624 (2023-06)
Sphere2Vec: A General-Purpose Location Representation Learning over a Spherical Surface for Large-Scale Geospatial Predictions
compute_mrr_by_latlongrid 2 other papers
2 dated earlier
2201.10489 (2022-01)
Sphere2Vec: Multi-Scale Representation Learning over a Spherical Surface for Geospatial Predictions
2306.17624 (2023-06)
Sphere2Vec: A General-Purpose Location Representation Learning over a Spherical Surface for Large-Scale Geospatial Predictions
plot_locs 2 other papers
2 dated earlier
2201.10489 (2022-01)
Sphere2Vec: Multi-Scale Representation Learning over a Spherical Surface for Geospatial Predictions
2306.17624 (2023-06)
Sphere2Vec: A General-Purpose Location Representation Learning over a Spherical Surface for Large-Scale Geospatial Predictions
embed_l2_normalize 1 other paper
1 dated earlier
2305.01118 (2023-05)
CSP: Self-Supervised Contrastive Spatial Pre-Training for Geospatial-Visual Representations

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

Spatial representation learning (SRL) aims at learning general-purpose neural network representations from various types of spatial data (e.g., points, polylines, polygons, networks, images, etc.) in their native formats. Learning good spatial representations is a fundamental problem for various downstream applications such as species distribution modeling, weather forecasting, trajectory generation, geographic question answering, etc. Even though SRL has become the foundation of almost all geospatial artificial intelligence (GeoAI) research, we have not yet seen significant efforts to develop an extensive deep learning framework and benchmark to support SRL model development and evaluation. To fill this gap, we propose TorchSpatial, a learning framework and benchmark for location (point) encoding, which is one of the most fundamental data types of spatial representation learning. TorchSpatial contains three key components: 1) a unified location encoding framework that consolidates 15 commonly recognized location encoders, ensuring scalability and reproducibility of the implementations; 2) the LocBench benchmark tasks encompassing 7 geo-aware image classification and 10 geo-aware image regression datasets; 3) a comprehensive suite of evaluation metrics to quantify geo-aware models' overall performance as well as their geographic bias, with a novel Geo-Bias Score metric. Finally, we provide a detailed analysis and insights into the model performance and geographic bias of different location encoders. We believe TorchSpatial will foster future advancement of spatial representation learning and spatial fairness in GeoAI research.

For agents

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

get_harvested_code_for_paper("2406.15658")
get_code_for_paper("2406.15658")
have("2406.15658")

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

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

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

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

Connect an agent — have() is free.