SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1807.01442 · 2018

Modeling Sparse Deviations for Compressed Sensing using Generative Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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 6 have no contract verdict; 0 failures of our instrument; 5 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/1807.01442.json · badge: /api/ran/1807.01442.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
ermongroup/sparse_gen community (classifier label)
classifier basis not recorded on the link
7 ran · 5 no recorded run
FunctionStatusWhere it lives
conv_cond_concat Ran
ran on a synthesized input
ermongroup/sparse_gen/celebA_dcgan/ops.py
code served (permissive licence) · get_code("bcb75c6ee41f4e8c")
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 SymbolicTensor. 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 numpy as np

# Create small test tensors
# x: feature map tensor with shape [batch, height, width, channels]
# y: conditioning vector with shape [batch, 1, 1, cond_channels]

batch_size = 2
height = 4
width = 3
x_channels = 5
y_channels = 6

# Create x as a feature map (batch, height, width, channels)
x = tf.constant(np.random.randn(batch_size, height, width, x_channels), dtype=tf.float32)

# Create y as a conditioning vector (batch, 1, 1, channels)
y = tf.constant(np.random.randn(batch_size, 1, 1, y_channels), dtype=tf.float32)

ARGS = {
    'x': x,
    'y': y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
dct2 Ran
ran, honoured the contract we drafted
ermongroup/sparse_gen/src/celebA_estimators.py
pointer only (licence: MIT); the stored copy get_code serves, from liuzq09/generativepca, is pointer only (licence: NONE) · get_code("be8b7b7d68c87b2a")
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 liuzq09/generativepca, 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.

find_overlap_idx Ran
ran on a synthesized input
ermongroup/sparse_gen/src/create_scripts.py
code served (permissive licence) · get_code("86c8f09d190ff0de")
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 torch

torch.manual_seed(0)

ARGS = {
    "list_of_strs": ["hello world", "foo bar", "test string", "python code"],
    "str_to_search": "world"
}
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 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
get_figsize Ran
ran on a synthesized input
ermongroup/sparse_gen/src/metrics_utils.py
code served (permissive licence) · get_code("857ba6b23095a4f0")
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 list, 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 torch
import numpy as np

# The function get_figsize takes a single boolean parameter 'is_save'
# and returns a figsize list if is_save is True, or None otherwise.
# We'll test both cases by creating two separate argument dictionaries.

# Test case 1: is_save = True
ARGS = {
    "is_save": True
}
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 list, ndim 1, dtype family int — a list 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
get_setting_specific_name Ran
ran on a synthesized input
ermongroup/sparse_gen/src/create_scripts.py
code served (permissive licence) · get_code("3d3ef93a89259d1c")
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

# Analyze the function: it takes a setting_dict, filters out certain keys,
# sorts the remaining keys, and creates a filename string from key-value pairs.
# The function only calls .keys(), .difference(), .sort(), .items via iteration,
# and str() conversions. It needs a dict with various keys.

setting_dict = {
    'learning_rate': 0.001,
    'batch_size': 32,
    'epochs': 10,
    'optimizer': 'adam',
    'script_type': 'train',
    'task': 'classification',
    'sequence_length': 100,
    'cell_type': 'lstm',
    'dropout': 0.5,
    'hidden_dim': 128
}

ARGS = {
    'setting_dict': setting_dict
}
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
int_or_float Ran
ran on a synthesized input
ermongroup/sparse_gen/src/metrics_utils.py
code served (permissive licence) · get_code("3a73f73ee48b894d")
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 torch

torch.manual_seed(0)

ARGS = {
    "val": "42"
}
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 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
omniglot_input Ran
ran on a synthesized input
ermongroup/sparse_gen/src/data_utils.py
code served (permissive licence) · get_code("c773299620e13a0d")
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 dict. 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
from unittest.mock import Mock, patch
import tempfile
import os

# Create a temporary directory structure with mock data
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'omniglot')
os.makedirs(data_dir, exist_ok=True)

# Create mock omniglot test data: small array of shape (10, 28, 28)
# 10 test images of 28x28 pixels
test_data = np.random.randint(0, 256, size=(10, 28, 28), dtype=np.uint8)
np.save(os.path.join(data_dir, 'test.npy'), test_data)

# Create mock validation data
validation_data = np.random.randint(0, 256, size=(10, 28, 28), dtype=np.uint8)
np.save(os.path.join(data_dir, 'validation.npy'), validation_data)

# Create a minimal hparams config object
class HParams:
    def __init__(self, input_type='full-input', num_input_images=5):
        self.input_type = input_type
        self.num_input_images = num_input_images

hparams = HParams(input_type='full-input', num_input_images=5)

# Patch the data loading to use our temp directory
import sys
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'hparams': hparams
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
construct_gen Not yet run
unverified (harvested, no recorded run)
ermongroup/sparse_gen/src/mnistomni_estimators.py
code served (permissive licence) · get_code("51642190cecd98f2")
How it ran

no invocation recorded.

deconv2d Not yet run
unverified (harvested, no recorded run)
ermongroup/sparse_gen/celebA_dcgan/ops.py
code served (permissive licence) · get_code("e4d1391909610011")
How it ran

no invocation recorded.

get_celebA_image Not yet run
unverified (harvested, no recorded run)
ermongroup/sparse_gen/src/data_utils.py
code served (permissive licence) · get_code("8c91f61cec3f247c")
How it ran

no invocation recorded.

linear Not yet run
unverified (harvested, no recorded run)
ermongroup/sparse_gen/celebA_dcgan/ops.py
code served (permissive licence) · get_code("52f4c4d5640407e3")
How it ran

no invocation recorded.

load_if_pickled Not yet run
unverified (harvested, no recorded run)
ermongroup/sparse_gen/src/metrics_utils.py
code served (permissive licence) · get_code("58eeaa12bb733123")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 9 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 5 later) and 3 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
conv_cond_concat 2 other papers
2 dated earlier
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1802.08406 (2018-02)
Solving Linear Inverse Problems Using GAN Priors: An Algorithm with Provable Guarantees
find_overlap_idx 2 other papers
1 dated earlier, 1 later
1703.03208 (2017-03)
Compressed Sensing using Generative Models
2006.09461 (2020-06)
Robust Compressed Sensing using Generative Models
get_figsize 2 other papers
2 later
2006.09461 (2020-06)
Robust Compressed Sensing using Generative Models
2106.12182 (2021-06)
Fairness for Image Generation with Uncertain Sensitive Attributes
int_or_float 2 other papers
2 later
2006.09461 (2020-06)
Robust Compressed Sensing using Generative Models
2106.12182 (2021-06)
Fairness for Image Generation with Uncertain Sensitive Attributes
dct2 1 other paper
1 later
2203.09693 (2022-03)
Generative Principal Component Analysis
deconv2d 1 other paper
1 dated earlier
1802.08406 (2018-02)
Solving Linear Inverse Problems Using GAN Priors: An Algorithm with Provable Guarantees
get_setting_specific_name 1 other paper
1 dated earlier
1703.03208 (2017-03)
Compressed Sensing using Generative Models
linear 1 other paper
1 dated earlier
1802.08406 (2018-02)
Solving Linear Inverse Problems Using GAN Priors: An Algorithm with Provable Guarantees
load_if_pickled 1 other paper
1 later
2106.12182 (2021-06)
Fairness for Image Generation with Uncertain Sensitive Attributes

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

In compressed sensing, a small number of linear measurements can be used to reconstruct an unknown signal. Existing approaches leverage assumptions on the structure of these signals, such as sparsity or the availability of a generative model. A domain-specific generative model can provide a stronger prior and thus allow for recovery with far fewer measurements. However, unlike sparsity-based approaches, existing methods based on generative models guarantee exact recovery only over their support, which is typically only a small subset of the space on which the signals are defined. We propose Sparse-Gen, a framework that allows for sparse deviations from the support set, thereby achieving the best of both worlds by using a domain specific prior and allowing reconstruction over the full space of signals. Theoretically, our framework provides a new class of signals that can be acquired using compressed sensing, reducing classic sparse vector recovery to a special case and avoiding the restrictive support due to a generative model prior. Empirically, we observe consistent improvements in reconstruction accuracy over competing approaches, especially in the more practical setting of transfer compressed sensing where a generative model for a data-rich, source domain aids sensing on a data-scarce, target domain.

For agents

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

get_harvested_code_for_paper("1807.01442")
get_code_for_paper("1807.01442")
have("1807.01442")

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

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

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

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

Connect an agent — have() is free.