SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.03939 · 2021

Photometric Redshifts from SDSS Images with an Interpretable Deep Capsule Network

arXiv · PDF · Open in the Atlas

Code that ran

3 of 17 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 3 have no contract verdict; 0 failures of our instrument; 14 no recorded run), measured 2026-11-23; 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/2112.03939.json · badge: /api/ran/2112.03939.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
biprateep/encapZulate-1 canonical (classifier label)
classifier basis not recorded on the link
3 ran · 14 no recorded run
FunctionStatusWhere it lives
central_bias Ran
ran on a synthesized input
biprateep/encapZulate-1/src/encapzulate/base/loss.py
code served (permissive licence) · get_code("81c96231f346fb2e")
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 function. 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 tensorflow as tf
from keras import backend as K
import numpy as np

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

# Create small test tensors for y_true and y_pred
batch_size = 2
num_quantiles_val = 5

# For testing, we need to create mock y_true and y_pred
# y_true shape: (batch_size,) - single values per sample
# y_pred shape: (batch_size, num_quantiles) - quantile predictions per sample
y_true = tf.constant([[0.5], [0.3]], dtype=tf.float32)
y_pred = tf.constant([[0.1, 0.2, 0.4, 0.6, 0.8], [0.15, 0.25, 0.35, 0.55, 0.75]], dtype=tf.float32)

# kwargs dict with required parameters
kwargs_dict = {
    'logistic': False,  # Set to False to skip the logistic transformation
    'z_max': 1.0,
    'z_min': 0.0
}

# ARGS maps the parameter name to its value
ARGS = {
    'num_quantiles': num_quantiles_val,
    'kwargs': kwargs_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
central_mse Ran
ran on a synthesized input
biprateep/encapZulate-1/src/encapzulate/base/loss.py
code served (permissive licence) · get_code("fa884912b636d261")
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 function. 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 tensorflow as tf
import keras.backend as K
import numpy as np

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

# Create small test tensors
batch_size = 2
num_quantiles = 5

# Create dummy y_true and y_pred tensors
# y_true: shape (batch_size, 1) - single true value per sample
y_true = tf.constant([[0.5], [0.3]], dtype=tf.float32)

# y_pred: shape (batch_size, num_quantiles) - predictions for each quantile
y_pred = tf.constant([
    [0.1, 0.2, 0.4, 0.6, 0.8],
    [0.15, 0.25, 0.35, 0.55, 0.75]
], dtype=tf.float32)

# Define kwargs with required parameters
kwargs = {
    'logistic': False,  # boolean flag for logistic transformation
    'z_max': 1.0,       # max value for normalization (used if logistic=True)
    'z_min': 0.0,       # min value for normalization (used if logistic=True)
}

# Construct the ARGS dictionary
ARGS = {
    'num_quantiles': num_quantiles,
    'kwargs': kwargs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
load_mnist Ran
ran on a synthesized input
biprateep/encapZulate-1/src/encapzulate/data_loader/data_loader.py
code served (permissive licence) · get_code("ea3d5625d0edc156")
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.

from keras.datasets import cifar10, cifar100, mnist
from keras.utils import to_categorical
import numpy as np

# Mock the mnist.load_data() to avoid network calls
original_load_data = mnist.load_data

def mock_mnist_load_data():
    # Create small dummy MNIST data
    x_train = np.random.randint(0, 256, (10, 28, 28), dtype=np.uint8)
    y_train = np.random.randint(0, 10, (10,), dtype=np.int64)
    x_test = np.random.randint(0, 256, (5, 28, 28), dtype=np.uint8)
    y_test = np.random.randint(0, 10, (5,), dtype=np.int64)
    return (x_train, y_train), (x_test, y_test)

mnist.load_data = mock_mnist_load_data

# Define ARGS for load_mnist function
ARGS = {
    'num_class': 10,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, 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
CapsNet Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/models/mnist.py
code served (permissive licence) · get_code("4c2151e7395bab36")
How it ran

no invocation recorded.

CapsNet Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/models/morphCaps.py
code served (permissive licence) · get_code("6cb5c4cdcc763ed0")
How it ran

no invocation recorded.

PrimaryCap Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/capsulelayers.py
code served (permissive licence) · get_code("14652bd7094d5f4e")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/run_model.py
code served (permissive licence) · get_code("bcc255c29c35ada2")
How it ran

no invocation recorded.

load_cifar10 Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/data_loader/data_loader.py
code served (permissive licence) · get_code("d918fcad643bf10e")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/data_loader/data_loader.py
code served (permissive licence) · get_code("cc46682041726145")
How it ran

no invocation recorded.

mqe Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/loss.py
code served (permissive licence) · get_code("41b0a8638f636a11")
How it ran

no invocation recorded.

own_batch_dot Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/batchdot.py
code served (permissive licence) · get_code("9c7dfeb5dfb34d6c")
How it ran

no invocation recorded.

predict Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/run_model.py
code served (permissive licence) · get_code("294b452ea4501cb9")
How it ran

no invocation recorded.

squash Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/capsulelayers.py
code served (permissive licence) · get_code("ae823ae127199b54")
How it ran

no invocation recorded.

squash Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/deepCapsLayers.py
code served (permissive licence) · get_code("7c3da8b78efbfce9")
How it ran

no invocation recorded.

squeeze Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/deepCapsLayers.py
code served (permissive licence) · get_code("e7e5a13dd8c18121")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/run_model.py
code served (permissive licence) · get_code("79a4779ca17d1af8")
How it ran

no invocation recorded.

update_routing Not yet run
unverified (harvested, no recorded run)
biprateep/encapZulate-1/src/encapzulate/base/deepCapsLayers.py
code served (permissive licence) · get_code("2b1b2c6fa385e1f1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 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 13 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
squash 2 other papers
2 dated earlier
1710.09829 (2017-10)
Dynamic Routing Between Capsules
1807.10108 (2018-07)
Effects of Degradations on Deep Neural Network Architectures
squash 2 other papers
2 dated earlier
1710.09829 (2017-10)
Dynamic Routing Between Capsules
1904.09546 (2019-04)
DeepCaps: Going Deeper with Capsule Networks
PrimaryCap 1 other paper
1 dated earlier
1710.09829 (2017-10)
Dynamic Routing Between Capsules
squeeze 1 other paper
1 dated earlier
1904.09546 (2019-04)
DeepCaps: Going Deeper with Capsule Networks

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

Studies of cosmology, galaxy evolution, and astronomical transients with current and next-generation wide-field imaging surveys like the Rubin Observatory Legacy Survey of Space and Time (LSST) are all critically dependent on estimates of photometric redshifts. Capsule networks are a new type of neural network architecture that is better suited for identifying morphological features of the input images than traditional convolutional neural networks. We use a deep capsule network trained on $ugriz$ images, spectroscopic redshifts, and Galaxy Zoo spiral/elliptical classifications of $\sim$400,000 Sloan Digital Sky Survey (SDSS) galaxies to do photometric redshift estimation. We achieve a photometric redshift prediction accuracy and a fraction of catastrophic outliers that are comparable to or better than current methods for SDSS main galaxy sample-like data sets ($r\leq17.8$ and $z_{\mathrm{spec}}\leq0.4$) while requiring less data and fewer trainable parameters. Furthermore, the decision-making of our capsule network is much more easily interpretable as capsules act as a low-dimensional encoding of the image. When the capsules are projected on a 2-dimensional manifold, they form a single redshift sequence with the fraction of spirals in a region exhibiting a gradient roughly perpendicular to the redshift sequence. We perturb encodings of real galaxy images in this low-dimensional space to create synthetic galaxy images that demonstrate the image properties (e.g., size, orientation, and surface brightness) encoded by each dimension. We also measure correlations between galaxy properties (e.g., magnitudes, colours, and stellar mass) and each capsule dimension. We publicly release our code, estimated redshifts, and additional catalogues at https://biprateep.github.io/encapZulate-1 .

For agents

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

get_harvested_code_for_paper("2112.03939")
get_code_for_paper("2112.03939")
have("2112.03939")

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

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

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

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

Connect an agent — have() is free.