SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.06919 · 2025

Correcting for interloper contamination in the power spectrum with neural networks

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2504.06919.json · badge: /api/ran/2504.06919.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
mcagliari/nointernet canonical (classifier label)
classifier basis not recorded on the link
5 ran · 4 no recorded run
FunctionStatusWhere it lives
fraction_type Ran
ran on a synthesized input
mcagliari/nointernet/src/catalogs-stats/Bk_displace_all.py
code served (permissive licence) · get_code("5344ecff122e916f")
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 float, ndim 0, dtype family float, 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 argparse

def fraction_type(arg):
    """ Type function for argparse - a float within [0,1] """
    try:
        f = float(arg)
    except ValueError:
        f = str(arg)
    if type(f) == float:
        if f < 0.0 or f > 1.0:
            raise argparse.ArgumentTypeError('Argument must be <= ' + str(1) + 'and >= ' + str(0))
    return f


ARGS = {
    'arg': '0.5'
}
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 float, ndim 0, dtype family float, 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
normalize_02 Ran
ran on a synthesized input
mcagliari/nointernet/src/training/NoInterNet_model.py
code served (permissive licence) · get_code("52519005744904b3")
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 sample data for normalize_02
# Pks should be a 2D numpy array where:
# - First nP columns are P0 values
# - Remaining columns are P2 values
# Let's use batch size 2, with nP=3 and 2 P2 columns (total 5 columns)

batch_size = 2
nP = 3
n_p2 = 2
total_cols = nP + n_p2

# Create random Pks array with positive values to avoid division issues
Pks = np.random.rand(batch_size, total_cols) * 10.0 + 1.0

ARGS = {
    "Pks": Pks,
    "nP": nP
}
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
normalize_Pk Ran
ran on a synthesized input
mcagliari/nointernet/src/training/NoInterNet_model.py
code served (permissive licence) · get_code("301ad3e3f1cf155b")
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 a sample Pks array
# Shape: (batch_size, num_features)
# Using distinct dimensions: 3 samples, 5 features
Pks = np.array([
    [1.0, 2.0, 3.0, 4.0, 5.0],
    [2.0, 4.0, 6.0, 8.0, 10.0],
    [0.5, 1.5, 2.5, 3.5, 4.5]
], dtype=np.float32)

ARGS = {
    "Pks": Pks
}
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
objective Ran
ran on a synthesized input
mcagliari/nointernet/src/training/NoInterNet_hyper_optimization.py
code served (permissive licence) · get_code("1a265dffcebeaf86")
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 float, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 os
from unittest.mock import Mock

torch.manual_seed(0)

# Create a minimal params object with all required attributes
class Params:
    def __init__(self):
        self.log = True
        self.logLoss = False
        self.k_max = 2.5
        self.output_hyp = '/tmp/test_hyp'
        self.output = None
        self.n_min = None
        self.neurons = None
        self.learning_rate = None
        self.batch_size = None
        self.opt = None

params = Params()

# Create a mock trial object that implements suggest_categorical and suggest_float
class MockTrial:
    def __init__(self):
        self.call_count = {}
    
    def suggest_categorical(self, name, choices):
        if name not in self.call_count:
            self.call_count[name] = 0
        idx = self.call_count[name] % len(choices)
        self.call_count[name] += 1
        return choices[idx]
    
    def suggest_float(self, name, low, high, log=False):
        if name not in self.call_count:
            self.call_count[name] = 0
        self.call_count[name] += 1
        if log:
            import numpy as np
            return np.exp(np.log(low) + (np.log(high) - np.log(low)) * 0.5)
        return (low + high) / 2.0

trial = MockTrial()

# Create a mock main function that returns a list with a minimal loss value
def main(params):
    return [0.5, 0.4, 0.3]

# Patch the main function into the objective's namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'main', main)
setattr(current_module, 'params', params)

ARGS = {
    'trial': trial
}
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 float, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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
objective Ran
ran on a synthesized input
mcagliari/nointernet/src/training/NoInterNet_hyper_optimization_PB.py
code served (permissive licence) · get_code("1cae86a8911fca0a")
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 float, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 os
from unittest.mock import MagicMock

torch.manual_seed(0)

# Create a mock trial object that suggests hyperparameters
class MockTrial:
    def __init__(self):
        self.suggestions = {
            'n_min': 8,
            'neurons': 128,
            'n_out': 16,
            'learning_rate': 0.001,
            'batch_size': 32
        }
        self.call_count = {}
    
    def suggest_categorical(self, name, options):
        return self.suggestions.get(name, options[0])
    
    def suggest_float(self, name, low, high, log=False):
        return self.suggestions.get(name, (low + high) / 2)

# Create a mock params object with required attributes
class MockParams:
    def __init__(self):
        self.log = True
        self.logLoss = False
        self.k_max = 1.5
        self.output_hyp = '/tmp/hyper_opt'
        self.output = None
        self.n_min = None
        self.neurons = None
        self.learning_rate = None
        self.batch_size = None
        self.opt = None
        self.n_out = None

params = MockParams()

# Create a mock main function that returns a list of losses
def mock_main(params):
    return [0.5, 0.4, 0.3, 0.2]

# Monkey patch the main function in the module scope
import sys
current_module = sys.modules[__name__]
current_module.main = mock_main
current_module.params = params

ARGS = {
    'trial': MockTrial()
}
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 float, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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_PBf Not yet run
unverified (harvested, no recorded run)
mcagliari/nointernet/src/training/NoInterNet_fraction_model.py
code served (permissive licence) · get_code("e58b823ec81527fc")
How it ran

no invocation recorded.

load_Pk Not yet run
unverified (harvested, no recorded run)
mcagliari/nointernet/src/training/NoInterNet_model.py
code served (permissive licence) · get_code("941bec4e290a0062")
How it ran

no invocation recorded.

load_Pkf Not yet run
unverified (harvested, no recorded run)
mcagliari/nointernet/src/training/NoInterNet_fraction_model.py
code served (permissive licence) · get_code("8c992876dbb3274d")
How it ran

no invocation recorded.

load_Pkf_feat Not yet run
unverified (harvested, no recorded run)
mcagliari/nointernet/src/training/NoInterNet_fraction_model.py
code served (permissive licence) · get_code("feae8ae6a4180723")
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-24.

Repositories linked to this paper

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

Abstract

Modern slitless spectroscopic surveys, such as Euclid and the Roman Space Telescope, collect vast numbers of galaxy spectra but suffer from low signal-to-noise ratios. This often leads to incorrect redshift assignments when relying on a single emission line, due to noise spikes or contamination from non-target emission lines, commonly referred to as redshift interlopers. We propose a machine learning approach to correct the impact of interlopers at the level of measured summary statistics, focusing on the power spectrum monopole and line interlopers as a proof of concept. To model interloper effects, we use halo catalogs from the Quijote simulations as proxies for galaxies, displacing a fraction of halos by the distance corresponding to the redshift offset between target and interloper galaxies. This yields contaminated catalogs with varying interloper fractions across a wide range of cosmologies from the Quijote suite. We train a neural network on the power spectrum monopole, alone or combined with the bispectrum monopole, from contaminated mocks to estimate the interloper fraction and reconstruct the cleaned power spectrum. We evaluate performance in two settings: one with fixed cosmology and another where cosmological parameters vary under broad priors. In the fixed case, the network recovers the interloper fraction and corrects the power spectrum to better than 1% accuracy. When cosmology varies, performance degrades, but adding bispectrum information significantly improves results, reducing the interloper fraction error by 40-60%. We also study the method's performance as a function of the size of the training set and find that optimal strategies depend on the correlation between target and interloper samples: bispectrum information aids performance when target and interloper galaxies are uncorrelated, while tighter priors are more effective when the two are strongly correlated.

For agents

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

get_harvested_code_for_paper("2504.06919")
get_code_for_paper("2504.06919")
have("2504.06919")

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

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

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

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

Connect an agent — have() is free.