SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1612.03897 · 2016

Inverse Compositional Spatial Transformer Networks

arXiv · PDF · Open in the Atlas

Code that ran

10 of 21 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 8 have no contract verdict; 2 failures of our instrument; 11 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/1612.03897.json · badge: /api/ran/1612.03897.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
chenhsuanlin/inverse-compositional-STN canonical (classifier label)
classifier basis: census
10 ran · 11 no recorded run
FunctionStatusWhere it lives
compose Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/warp.py
code served (permissive licence) · get_code("2c9f16bc5becd024")
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 2, dtype family float, shape (2, 6) as a later run recorded it. 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, 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)

class Options:
    def __init__(self, warpType, batchSize):
        self.warpType = warpType
        self.batchSize = batchSize

# Create a small options object for 'affine' warp type
opt = Options(warpType='affine', batchSize=2)

# For 'affine' warp type, p should have 6 parameters per batch element
# p: shape (batchSize, 6)
p = torch.randn(2, 6, dtype=torch.float32)

# dp: shape (batchSize, 6) - delta parameters
dp = torch.randn(2, 6, dtype=torch.float32)

ARGS = {
    'opt': opt,
    'p': p,
    'dp': dp
}
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 2, dtype family float, shape (2, 6) — shape (2, 6) 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
compose Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/warp.py
code served (permissive licence) · get_code("596305e0db476c13")
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 EagerTensor, ndim 2, dtype family float, shape (2, 8) 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 tensorflow as tf
import numpy as np

class OptConfig:
    def __init__(self, warpType, batchSize):
        self.warpType = warpType
        self.batchSize = batchSize

# Test with 'homography' warpType since it uses the most parameters
opt = OptConfig(warpType='homography', batchSize=2)

# For homography, p and dp should have shape [batchSize, 8]
# (8 parameters: p1, p2, p3, p4, p5, p6, p7, p8)
p = tf.constant([
    [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
    [0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75]
], dtype=tf.float32)

dp = tf.constant([
    [0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09],
    [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08]
], dtype=tf.float32)

ARGS = {
    'opt': opt,
    'p': p,
    'dp': dp
}
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 EagerTensor, ndim 2, dtype family float, shape (2, 8) — shape (2, 8) 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
fit Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/warp.py
code served (permissive licence) · get_code("5dfbbadd25cd659e")
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 ndarray, ndim 2, dtype family float, shape (3, 3) 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 numpy as np

# The fit function expects two numpy arrays:
# - Xsrc: source points, shape (N, 2) where N is number of points
# - Xdst: destination points, shape (N, 2)
# The function computes a 2D affine transformation matrix

# Create small sample point sets
# Using 4 points for a small but sufficient example
Xsrc = np.array([
    [0.0, 0.0],
    [1.0, 0.0],
    [0.0, 1.0],
    [1.0, 1.0]
], dtype=np.float32)

# Destination points (slightly transformed version)
Xdst = np.array([
    [0.5, 0.5],
    [1.5, 0.3],
    [0.2, 1.5],
    [1.3, 1.2]
], dtype=np.float32)

ARGS = {
    "Xsrc": Xsrc,
    "Xdst": Xdst
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 3) — shape (3, 3) 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
genPerturbations Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/data.py
code served (permissive licence) · get_code("33a8241e6552df9f")
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 2, dtype family float, shape (2, 6) as a later run recorded it. 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, 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 numpy as np
import torch

class OptConfig:
    def __init__(self):
        self.canon4pts = np.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]], dtype=np.float32)
        self.batchSize = 2
        self.pertScale = 0.1
        self.transScale = 0.05
        self.warpType = 'affine'

opt = OptConfig()

ARGS = {
    'opt': opt
}
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 Tensor, ndim 2, dtype family float, shape (2, 6) — shape (2, 6) 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
inverse Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/warp.py
code served (permissive licence) · get_code("84120307d6fea550")
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 2, dtype family float, shape (2, 8) as a later run recorded it. 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, 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)

class OptConfig:
    def __init__(self, warpType, batchSize):
        self.warpType = warpType
        self.batchSize = batchSize

# Test with 'homography' warpType which requires 8 parameters
opt = OptConfig(warpType='homography', batchSize=2)

# Create parameter tensor for homography (batch=2, params=8)
p = torch.randn(2, 8, dtype=torch.float32)

ARGS = {
    'opt': opt,
    'p': p
}
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 2, dtype family float, shape (2, 8) — shape (2, 8) 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
makeBatch Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/data.py
code served (permissive licence) · get_code("7c3e5774c45de093")
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. 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 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

torch.manual_seed(0)

class OptConfig:
    def __init__(self):
        self.batchSize = 2

opt = OptConfig()

data = {
    'image': torch.randn(5, 4),
    'label': torch.randint(0, 2, (5, 3))
}

ARGS = {
    'opt': opt,
    'data': data
}
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 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
makeBatch Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/data.py
code served (permissive licence) · get_code("ff53e728d97c7cf1")
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
import torch

# Create a minimal options object with batchSize attribute
class Opt:
    def __init__(self):
        self.batchSize = 2

opt = Opt()

# Create data dictionary with image and label arrays
data = {
    'image': np.random.randn(5, 4, 3),  # 5 samples, 4x3 image shape
    'label': np.random.randint(0, 10, size=(5,))  # 5 labels
}

# Create placeholder tuple (image, label) - these are used as dictionary keys
image = 'image_key'
label = 'label_key'
PH = (image, label)

ARGS = {
    'opt': opt,
    'data': data,
    'PH': PH
}
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 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
makeBatch Ran
ran on a synthesized input
chenhsuanlin/inverse-compositional-STN/traffic-sign-tensorflow/data.py
code served (permissive licence) · get_code("52c91f01d037ba45")
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

class OptConfig:
    def __init__(self):
        self.batchSize = 2

opt = OptConfig()

data = {
    'image': np.random.randint(0, 256, size=(5, 4, 3), dtype=np.uint8),
    'label': np.random.randint(0, 10, size=(5,), dtype=np.int64)
}

image_placeholder = 'image_key'
label_placeholder = 'label_key'
PH = [image_placeholder, label_placeholder]

ARGS = {
    'opt': opt,
    'data': data,
    'PH': PH
}
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
toGreen Ran
ran; our contract draft was wrong, not the code
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/util.py
code served (permissive licence) · get_code("045caed495c3be39")
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 termcolor

ARGS = {
    'content': 'Hello, World!'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor — 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
toRed Ran
ran; our contract draft was wrong, not the code
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/util.py
code served (permissive licence) · get_code("23debb41fe868b57")
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 termcolor

def toRed(content):
    return termcolor.colored(content, 'red', attrs=['bold'])

# The function takes a single parameter 'content' which is passed to termcolor.colored()
# termcolor.colored() expects a string as the first argument
# We'll pass a simple string

ARGS = {
    'content': 'Hello World'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor — 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
CNN Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/graph.py
code served (permissive licence) · get_code("18200a028bb94600")
How it ran

no invocation recorded.

CNN Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/traffic-sign-tensorflow/graph.py
code served (permissive licence) · get_code("927d2eba9569f165")
How it ran

no invocation recorded.

fit Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/warp.py
code served (permissive licence) · get_code("91f76d01aa3d7d32")
How it ran

no invocation recorded.

fullCNN Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/graph.py
code served (permissive licence) · get_code("c573e2402b9ab542")
How it ran

no invocation recorded.

fullCNN Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/traffic-sign-tensorflow/graph.py
code served (permissive licence) · get_code("1b6acb34c9c1f141")
How it ran

no invocation recorded.

genPerturbations Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/data.py
code served (permissive licence) · get_code("d8fc92d0acf479c7")
How it ran

no invocation recorded.

imread Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/util.py
code served (permissive licence) · get_code("4497ff1ceb01b614")
How it ran

no invocation recorded.

inverse Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/warp.py
code served (permissive licence) · get_code("f3f178e78c6f4924")
How it ran

no invocation recorded.

loadGTSRB Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/traffic-sign-tensorflow/data.py
code served (permissive licence) · get_code("d110495f61819df2")
How it ran

no invocation recorded.

loadMNIST Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-pytorch/data.py
code served (permissive licence) · get_code("3b5d766ce4e302bd")
How it ran

no invocation recorded.

loadMNIST Not yet run
unverified (harvested, no recorded run)
chenhsuanlin/inverse-compositional-STN/MNIST-tensorflow/data.py
code served (permissive licence) · get_code("e06edf719e4e194f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 17 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
toGreen 2 other papers
2 later
1803.01837 (2018-03)
ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing
2403.02611 (2024-03)
A Unified Framework for Microscopy Defocus Deblur with Multi-Pyramid Transformer and Contrastive Learning
toRed 2 other papers
2 later
1803.01837 (2018-03)
ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing
2403.02611 (2024-03)
A Unified Framework for Microscopy Defocus Deblur with Multi-Pyramid Transformer and Contrastive Learning
fit 1 other paper
1 later
1803.01837 (2018-03)
ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing
imread 1 other paper
1 later
1803.01837 (2018-03)
ST-GAN: Spatial Transformer Generative Adversarial Networks for Image Compositing

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 this paper, we establish a theoretical connection between the classical Lucas & Kanade (LK) algorithm and the emerging topic of Spatial Transformer Networks (STNs). STNs are of interest to the vision and learning communities due to their natural ability to combine alignment and classification within the same theoretical framework. Inspired by the Inverse Compositional (IC) variant of the LK algorithm, we present Inverse Compositional Spatial Transformer Networks (IC-STNs). We demonstrate that IC-STNs can achieve better performance than conventional STNs with less model capacity; in particular, we show superior performance in pure image alignment tasks as well as joint alignment/classification problems on real-world problems.

For agents

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

get_harvested_code_for_paper("1612.03897")
get_code_for_paper("1612.03897")
have("1612.03897")

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

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

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

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

Connect an agent — have() is free.