SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.07070 · 2021

Inpainting hydrodynamical maps with deep learning

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 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 2 have no contract verdict; 1 failure of our instrument; 2 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/2109.07070.json · badge: /api/ran/2109.07070.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
fgmohammad/inpainting canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
FunctionStatusWhere it lives
gram_matrix Ran
ran on a synthesized input
fgmohammad/inpainting/loss.py
code served (permissive licence) · get_code("1715f300a6a58899")
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 3, dtype family float, shape (2, 4, 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)

# Create a small feature tensor with shape (batch=2, channels=4, height=3, width=5)
# Using distinct sizes: batch=2, ch=4, h=3, w=5 to make dimensions unambiguous
feat = torch.randn(2, 4, 3, 5)

ARGS = {
    'feat': feat
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
total_variation_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fgmohammad/inpainting/loss.py
code served (permissive licence) · get_code("dedfa1b69056bdc7")
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

torch.manual_seed(0)

# The function expects a 4D tensor (batch, channels, height, width)
# It computes total variation loss by comparing adjacent pixels
# Using small but distinct dimensions: batch=2, channels=3, height=4, width=5
image = torch.randn(2, 3, 4, 5)

ARGS = {
    "image": image
}
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
training Ran
ran on a synthesized input
fgmohammad/inpainting/training.py
code served (permissive licence) · get_code("85fa944096a7fa91")
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 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
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau

torch.manual_seed(0)

# Define a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, mask, gt):
        # Returns: output, feats, comp_feats, feat_gt
        output = self.linear(x)
        feats = self.linear(x)
        comp_feats = self.linear(x)
        feat_gt = self.linear(gt)
        return output, feats, comp_feats, feat_gt

# Define a minimal criterion that satisfies the function's usage
class MinimalCriterion(nn.Module):
    def __init__(self):
        super().__init__()
        self.mse = nn.MSELoss()
    
    def forward(self, x, mask, output, gt, comp_feats, feats, feat_gt):
        # Must return a dict with keys that will have '_weight' attributes in args
        loss_dict = {
            'tv': self.mse(output, gt),
            'prc': self.mse(feats, feat_gt),
            'hole': self.mse(comp_feats, feat_gt),
            'style': self.mse(output, x),
            'valid': self.mse(comp_feats, feats)
        }
        return loss_dict

# Define args object with loss weights
class Args:
    def __init__(self):
        self.tv_weight = 1.0
        self.prc_weight = 0.5
        self.hole_weight = 0.3
        self.style_weight = 0.2
        self.valid_weight = 0.1

# Create small tensors: batch=2, feature_dim=4
batch_size = 2
feature_dim = 4

x_train = torch.randn(batch_size, feature_dim)
mask_train = torch.randn(batch_size, feature_dim)
gt_train = torch.randn(batch_size, feature_dim)

x_val = torch.randn(batch_size, feature_dim)
mask_val = torch.randn(batch_size, feature_dim)
gt_val = torch.randn(batch_size, feature_dim)

# Create data loaders as lists of tuples
train_loader = [
    (x_train, mask_train, gt_train),
    (x_train, mask_train, gt_train),
]

validation_loader = [
    (x_val, mask_val, gt_val),
    (x_val, mask_val, gt_val),
]

# Create model, criterion, optimizer, and scheduler
model = MinimalModel()
criterion = MinimalCriterion()
optimizer = Adam(model.parameters(), lr=0.001)
scheduler = ReduceLROnPlateau(optimizer, mode='min', factor=0.5, patience=5)
args = Args()

ARGS = {
    'train_loader': train_loader,
    'validation_loader': validation_loader,
    'criterion': criterion,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'model': model,
    'args': args,
    'device': None,
}
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 tuple, ndim 1, 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
DataParallel_withLoss Not yet run
unverified (harvested, no recorded run)
fgmohammad/inpainting/data_parallel.py
code served (permissive licence) · get_code("6b3336019f613fb1")
How it ran

no invocation recorded.

unnormalize Not yet run
unverified (harvested, no recorded run)
fgmohammad/inpainting/image_utils.py
code served (permissive licence) · get_code("c55b4fc41b0d513e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 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
gram_matrix 6 other papers
5 dated earlier, 1 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
2004.02788 (2020-04)
Self-Supervised Scene De-occlusion
and 3 more not named here
total_variation_loss 5 other papers
4 dated earlier, 1 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
2004.02788 (2020-04)
Self-Supervised Scene De-occlusion
and 2 more not named here

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

From 1,000 hydrodynamic simulations of the CAMELS project, each with a different value of the cosmological and astrophysical parameters, we generate 15,000 gas temperature maps. We use a state-of-the-art deep convolutional neural network to recover missing data from those maps. We mimic the missing data by applying regular and irregular binary masks that cover either $15\%$ or $30\%$ of the area of each map. We quantify the reliability of our results using two summary statistics: 1) the distance between the probability density functions (pdf), estimated using the Kolmogorov-Smirnov (KS) test, and 2) the 2D power spectrum. We find an excellent agreement between the model prediction and the unmasked maps when using the power spectrum: better than $1\%$ for $k<20 h/$Mpc for any irregular mask. For regular masks, we observe a systematic offset of $\sim5\%$ when covering $15\%$ of the maps while the results become unreliable when $30\%$ of the data is missing. The observed KS-test p-values favor the null hypothesis that the reconstructed and the ground-truth maps are drawn from the same underlying distribution when irregular masks are used. For regular-shaped masks on the other hand, we find a strong evidence that the two distributions do not match each other. Finally, we use the model, trained on gas temperature maps, to perform inpainting on maps from completely different fields such as gas mass, gas pressure, and electron density and also for gas temperature maps from simulations run with other codes. We find that visually, our model is able to reconstruct the missing pixels from the maps of those fields with great accuracy, although its performance using summary statistics depends strongly on the considered field.

For agents

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

get_harvested_code_for_paper("2109.07070")
get_code_for_paper("2109.07070")
have("2109.07070")

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

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

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

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

Connect an agent — have() is free.