SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.05424 · 2022

Hard-Constrained Deep Learning for Climate Downscaling

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure of our instrument; 0 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/2208.05424.json · badge: /api/ran/2208.05424.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
rolnicklab/constrained-downscaling canonical (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
conv3x3 Ran
ran; our contract draft was wrong, not the code
rolnicklab/constrained-downscaling/models.py
pointer only (licence: MIT); the stored copy get_code serves, from xiamenwcy/pictorial_net, is pointer only (licence: NONE) · get_code("18fbe72ffac82ee3")
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 xiamenwcy/pictorial_net, 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.

gan_optimizer_step Ran
ran on a synthesized input
rolnicklab/constrained-downscaling/training.py
code served (permissive licence) · get_code("aa8e026cf82a0f06")
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. 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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleGenerator(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(100, 64)
        self.conv = nn.Conv2d(1, 3, kernel_size=3, padding=1)
    
    def forward(self, inputs, z):
        z_flat = z.view(z.shape[0], -1)
        z_processed = self.linear(z_flat)
        z_reshaped = z_processed.view(z_processed.shape[0], 1, 8, 8)
        outputs = self.conv(z_reshaped)
        return outputs

class SimpleDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d(1)
        self.linear = nn.Linear(16, 1)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = x.view(x.shape[0], -1)
        x = self.linear(x)
        return x

model = SimpleGenerator()
discriminator_model = SimpleDiscriminator()

optimizer = torch.optim.Adam(model.parameters(), lr=0.0002)
optimizer_discr = torch.optim.Adam(discriminator_model.parameters(), lr=0.0002)

criterion = nn.MSELoss()
criterion_discr = nn.BCEWithLogitsLoss()

batch_size = 2
inputs = torch.randn(batch_size, 3, 8, 8)
targets = torch.randn(batch_size, 3, 8, 8)

tepoch = 0

class Args:
    def __init__(self):
        self.adv_factor = 0.1

args = Args()

ARGS = {
    'model': model,
    'discriminator_model': discriminator_model,
    'optimizer': optimizer,
    'optimizer_discr': optimizer_discr,
    'criterion': criterion,
    'criterion_discr': criterion_discr,
    'inputs': inputs,
    'targets': targets,
    'tepoch': tepoch,
    'args': args
}
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 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
get_optimizer Ran
ran on a synthesized input
rolnicklab/constrained-downscaling/utils.py
code served (permissive licence) · get_code("b9087c041eb91178")
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 Adam. 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 torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Build a minimal model
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = TinyModel()

# Build args with required parameters
class Args:
    def __init__(self):
        self.lr = 0.001
        self.weight_decay = 1e-5

args = Args()

ARGS = {
    'args': args,
    'model': model
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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_data Ran
ran on a synthesized input
rolnicklab/constrained-downscaling/utils.py
code served (permissive licence) · get_code("81dae2bf46e6e130")
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. 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
from torch.utils.data import DataLoader, TensorDataset
from unittest.mock import patch, MagicMock
import os
import tempfile

torch.manual_seed(0)

# Create a temporary directory structure for the mock data
temp_dir = tempfile.mkdtemp()
dataset_name = 'test_dataset'
dataset_path = os.path.join(temp_dir, 'data', dataset_name)
os.makedirs(os.path.join(dataset_path, 'train'), exist_ok=True)
os.makedirs(os.path.join(dataset_path, 'test'), exist_ok=True)
os.makedirs(os.path.join(dataset_path, 'val'), exist_ok=True)

# Create sample tensors with distinct dimensions
# Shape: (batch, time, channels, height, width)
batch_size = 2
time_steps = 1
dim_channels = 3
height = 4
width = 5

input_train = torch.randn(batch_size, time_steps, dim_channels, height, width)
target_train = torch.randn(batch_size, time_steps, dim_channels, height, width)
input_test = torch.randn(batch_size, time_steps, dim_channels, height, width)
target_test = torch.randn(batch_size, time_steps, dim_channels, height, width)
input_val = torch.randn(batch_size, time_steps, dim_channels, height, width)
target_val = torch.randn(batch_size, time_steps, dim_channels, height, width)

# Save tensors to files
torch.save(input_train, os.path.join(dataset_path, 'train', 'input_train.pt'))
torch.save(target_train, os.path.join(dataset_path, 'train', 'target_train.pt'))
torch.save(input_test, os.path.join(dataset_path, 'test', 'input_test.pt'))
torch.save(target_test, os.path.join(dataset_path, 'test', 'target_test.pt'))
torch.save(input_val, os.path.join(dataset_path, 'val', 'input_val.pt'))
torch.save(target_val, os.path.join(dataset_path, 'val', 'target_val.pt'))

# Create args object
class Args:
    def __init__(self):
        self.dataset = dataset_name
        self.test_val_train = 'test'
        self.batch_size = 2
        self.dim_channels = dim_channels

# Patch torch.load to use the correct path
original_load = torch.load
def patched_load(path):
    actual_path = path.replace('./data/', os.path.join(temp_dir, 'data', ''))
    return original_load(actual_path)

args = Args()

# Patch the load function's working directory
import sys
sys.modules['torch'].load = patched_load

ARGS = {
    'args': args
}
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 list — a list 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
meshgrid Ran
ran, honoured the contract we drafted
rolnicklab/constrained-downscaling/models.py
pointer only (licence: MIT); the stored copy get_code serves, from lxx1991/pytorch-voxel-flow, is pointer only (licence: NONE) · get_code("0bcee60a90a51b11")
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 lxx1991/pytorch-voxel-flow, 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.

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, 1 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
conv3x3 15 other papers
8 dated earlier, 7 later
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1805.04635 (2018-05)
Direction-aware Spatial Context Features for Shadow Detection and Removal
1807.01697 (2018-07)
Benchmarking Neural Network Robustness to Common Corruptions and Surface Variations
and 12 more not named here
meshgrid 1 other paper
1 dated earlier
1702.02463 (2017-02)
Video Frame Synthesis using Deep Voxel Flow

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

The availability of reliable, high-resolution climate and weather data is important to inform long-term decisions on climate adaptation and mitigation and to guide rapid responses to extreme events. Forecasting models are limited by computational costs and, therefore, often generate coarse-resolution predictions. Statistical downscaling, including super-resolution methods from deep learning, can provide an efficient method of upsampling low-resolution data. However, despite achieving visually compelling results in some cases, such models frequently violate conservation laws when predicting physical variables. In order to conserve physical quantities, here we introduce methods that guarantee statistical constraints are satisfied by a deep learning downscaling model, while also improving their performance according to traditional metrics. We compare different constraining approaches and demonstrate their applicability across different neural architectures as well as a variety of climate and weather data sets. Besides enabling faster and more accurate climate predictions through downscaling, we also show that our novel methodologies can improve super-resolution for satellite data and natural images data sets.

For agents

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

get_harvested_code_for_paper("2208.05424")
get_code_for_paper("2208.05424")
have("2208.05424")

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

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

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

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

Connect an agent — have() is free.