SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.15977 · CVPR · 2021

Flow-based Kernel Prior with Application to Blind Super-Resolution

Radu Timofte, Luc Gool, Kai Zhang, Jingyun Liang, Shuhang Gu

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 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; 0 failures of our instrument; 0 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/2103.15977.json · badge: /api/ran/2103.15977.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
JingyunLiang/FKP marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
BatchNorm Ran
ran on a synthesized input · constructed an object; no result was computed
JingyunLiang/FKP/FKP/network.py
code served (permissive licence) · get_code("eb02a51ee12f8816")
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 an instance of its own class, BatchNorm: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class BatchNorm(nn.Module):
    """ BatchNorm layer """

    def __init__(self, input_size, momentum=0.9, eps=1e-05):
        super().__init__()
        self.momentum = momentum
        self.eps = eps
        self.log_gamma = nn.Parameter(torch.zeros(input_size))
        self.beta = nn.Parameter(torch.zeros(input_size))
        self.register_buffer('running_mean', torch.zeros(input_size))
        self.register_buffer('running_var', torch.ones(input_size))

    def forward(self, x, cond_y=None):
        if self.training:
            self.batch_mean = x.mean(0)
            self.batch_var = x.var(0)
            self.running_mean.mul_(self.momentum).add_(self.batch_mean.data * (1 - self.momentum))
            self.running_var.mul_(self.momentum).add_(self.batch_var.data * (1 - self.momentum))
            mean = self.batch_mean
            var = self.batch_var
        else:
            mean = self.running_mean
            var = self.running_var
        x_hat = (x - mean) / torch.sqrt(var + self.eps)
        y = self.log_gamma.exp() * x_hat + self.beta
        log_abs_det_jacobian = (self.log_gamma - 0.5 * torch.log(var + self.eps)).sum()
        return (y, log_abs_det_jacobian)

    def inverse(self, y, cond_y=None):
        if self.training:
            mean = self.batch_mean
            var = self.batch_var
        else:
            mean = self.running_mean
            var = self.running_var
        x_hat = (y - self.beta) * torch.exp(-self.log_gamma)
        x = x_hat * torch.sqrt(var + self.eps) + mean
        log_abs_det_jacobian = (0.5 * torch.log(var + self.eps) - self.log_gamma).sum()
        return (x, log_abs_det_jacobian)


input_size = 4
batch_norm_layer = BatchNorm(input_size=input_size, momentum=0.9, eps=1e-05)
batch_norm_layer.train()

x = torch.randn(2, input_size)

ARGS = {
    'input_size': input_size,
    'momentum': 0.9,
    'eps': 1e-05
}
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 BatchNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BatchNorm 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
KernelPrior Ran
ran on a synthesized input · constructed an object; no result was computed
JingyunLiang/FKP/FKP/network.py
code served (permissive licence) · get_code("dd84d33d20283c71")
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 an instance of its own class, KernelPrior: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    'n_blocks': 2,
    'input_size': 4,
    'hidden_size': 8,
    'n_hidden': 1,
    'kernel_size': 0,
    'alpha': 0,
    'normalization': 0,
    'cond_label_size': 3,
    'batch_norm': True,
}
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 KernelPrior — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a KernelPrior 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

Also present in other papers' code

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

Kernel estimation is generally one of the key problems for blind image super-resolution (SR). Recently, Double-DIP proposes to model the kernel via a network architecture prior, while KernelGAN employs the deep linear network and several regularization losses to constrain the kernel space. However, they fail to fully exploit the general SR kernel assumption that anisotropic Gaussian kernels are sufficient for image SR. To address this issue, this paper proposes a normalizing flow-based kernel prior (FKP) for kernel modeling. By learning an invertible mapping between the anisotropic Gaussian kernel distribution and a tractable latent distribution, FKP can be easily used to replace the kernel modeling modules of Double-DIP and Ker-nelGAN. Specifically, FKP optimizes the kernel in the latent space rather than the network parameter space, which allows it to generate reasonable kernel initialization, traverse the learned kernel manifold and improve the optimization stability. Extensive experiments on synthetic and realworld images demonstrate that the proposed FKP can significantly improve the kernel estimation accuracy with less parameters, runtime and memory usage, leading to stateof-the-art blind SR results. * Corresponding author. kernels is becoming an active research topic. Compared to non-blind SR, blind SR generally needs to additionally estimate the blur kernel and thus is more illposed. A popular line of work tries to decompose blind SR into two sub-problems, i.e., kernel estimation and nonblind SR. As a preliminary step of non-blind SR, kernel estimation plays a crucial role. If the estimated kernel deviates from the ground-truth, the HR image reconstructed by the non-blind SR methods would deteriorate seriously [11,17,50]. In view of this, this paper focuses on the SR kernel estimation problem. Recently, some kernel estimation methods, such as Double-DIP [15,39] and KernelGAN [3], have shown promising results. Specifically, with two deep image priors (DIPs) [44], Double-DIP can be used to jointly optimize the HR image and blur kernel in the parameter space of untrained encoder-decoder networks by minimizing the LR image reconstruction error. Although DIP has shown to be effective for modeling natural images, whether it is effective to model blur kernel or not remains unclear. The main reason is that blur kernel usually has a small spatial size and has its own characteristics that differ from natural images. In [39], a fully-connected network (FCN) is used to model the kernel prior, which, however, lacks interpretability. With a different framework to Double-DIP, KernelGAN designs an internal generative adversarial network (GAN) for the LR image on the basis of image patch recurrence property [16,35,57]. It defines the kernel implicitly by a deep linear network, which is optimized by the GAN loss and five extra regularization losses such as sparsity loss. Obviously, these two methods do not make full use of the anisotropic Gaussian kernel prior which has been demonstrated to be effective enough for real image SR [11,40,50,54,55]. In this paper, we propose a flow-based kernel prior (FKP) for kernel distribution modeling and incorporate it into existing blind SR models. Based on normalizing flow, FKP consists of several batch normalization layers, permutation layers and affine coupling layers, which allow the model

For agents

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

get_harvested_code_for_paper("2103.15977")
get_code_for_paper("2103.15977")
have("2103.15977")

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

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

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

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

Connect an agent — have() is free.