SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.07440 · 2026

Variational Autoencoder with Normalizing flow for X-ray spectral fitting

Cecilia Garraffo, Fiona Redmen, Ethan Tregidga, James Steiner

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 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/2601.07440.json · badge: /api/ran/2601.07440.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
fi-redmen/fspnet-var canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
decoder_reconstruction Ran
ran; our contract draft was wrong, not the code
fi-redmen/fspnet-var/fspnetvar/utils/plot_utils.py
code served (permissive licence) · get_code("bf1b73419ea96260")
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; 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
import numpy as np

torch.manual_seed(0)

# Create a minimal decoder network
class MinimalDecoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal network with transforms
class MinimalNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.transforms = {
            'targets': self._target_transform,
            'inputs': self._input_transform
        }
    
    def _target_transform(self, x):
        # Transform that takes params and outputs 4-dim tensor
        return torch.FloatTensor(x).reshape(-1, 4)
    
    def _input_transform(self, x, back=False):
        # Transform that can go forward and backward
        if back:
            # Inverse transform: take 3-dim and output array
            return x.detach().numpy().reshape(1, -1)
        else:
            # Forward transform
            return x

decoder = MinimalDecoder()
network = MinimalNetwork()

# Create params as ndarray
params = np.array([0.1, 0.2, 0.3, 0.4])

ARGS = {
    'params': params,
    'decoder': decoder,
    'network': network,
    'spectrum': 'js_ni0100320101_0mpu7_goddard_GTI0.jsgrp',
    'data_dir': '/data/spectra/'
}
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 ndarray, ndim 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:NameError)
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
gaussian_loss Ran
ran; our contract draft was wrong, not the code
fi-redmen/fspnet-var/fspnetvar/main_VAE.py
code served (permissive licence) · get_code("c4de45b1f15b4400")
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 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 torch
from torch import nn

torch.manual_seed(0)

# The function expects:
# - predictions: tensor with shape (batch_size, >=1) where predictions[:, 0] is accessed
# - target: tensor with shape (batch_size, >=2) where target[:, 0] and target[:, 1] are accessed
# Both are used with GaussianNLLLoss which expects mean, target, and variance

predictions = torch.randn(2, 4)  # batch_size=2, features=4
target = torch.randn(2, 4)  # batch_size=2, must have at least 2 columns for mean and variance

ARGS = {
    "predictions": predictions,
    "target": target,
}
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 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
log_line Ran
ran, honoured the contract we drafted
fi-redmen/fspnet-var/fspnetvar/utils/plots_var.py
code served (permissive licence) · get_code("d223afdc8aaa1378")
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
import numpy as np

torch.manual_seed(0)

# The function log_line(x, m) computes x ** m
# x and m should be numeric types (int, float, or tensor)
# We'll use tensors for flexibility

x = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

m = 2.0

ARGS = {
    "x": x,
    "m": m
}
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 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
mse_loss Ran
ran; our contract draft was wrong, not the code
fi-redmen/fspnet-var/fspnetvar/main_VAE.py
code served (permissive licence) · get_code("8159e31cf9e2b274")
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 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 torch
from torch import nn

torch.manual_seed(0)

# Create small tensors: batch size 2, feature dim 4
# predictions should have shape (2, 4) so predictions[:, 0] is (2,)
predictions = torch.randn(2, 4)

# target should have shape (2, 4) so target[:, 0] is (2,)
target = torch.randn(2, 4)

ARGS = {
    "predictions": predictions,
    "target": target
}
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 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
line Not yet run
unverified (harvested, no recorded run)
fi-redmen/fspnet-var/fspnetvar/utils/plots_var.py
code served (permissive licence) · get_code("ea55db1d6f1762f4")
How it ran

no invocation recorded.

load_x_data Not yet run
unverified (harvested, no recorded run)
fi-redmen/fspnet-var/fspnetvar/data.py
code served (permissive licence) · get_code("0f87f3bdeb864630")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 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.

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

Black hole X-ray binaries (BHBs) can be studied with spectral fitting to provide physical constraints on accretion in extreme gravitational environments. Traditional methods of spectral fitting such as Markov Chain Monte Carlo (MCMC) face limitations due to computational times. We introduce a probabilistic model, utilizing a variational autoencoder with a normalizing flow, trained to adopt a physical latent space. This neural network produces predictions for spectral-model parameters as well as their full probability distributions. Our implementations result in a significant improvement in spectral reconstructions over a previous deterministic model while performing three orders of magnitude faster than traditional methods. Recent machine learning (ML) work for X-ray astronomy includes representation learning [21], with applications in anomaly detection, unsupervised classification, and similarity searches [3]. Previous ML work in spectral fitting has successfully applied autoencoders (AEs) to this problem, which achieved parameter-value inference 2 700 times faster than traditional techniques [20]. However,

For agents

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

get_harvested_code_for_paper("2601.07440")
get_code_for_paper("2601.07440")
have("2601.07440")

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

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

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

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

Connect an agent — have() is free.