SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1901.08428 · 2019

Cheap Orthogonal Constraints in Neural Networks: A Simple Parametrization of the Orthogonal and Unitary Group

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 5 have no contract verdict; 1 failure of our instrument; 3 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/1901.08428.json · badge: /api/ran/1901.08428.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
Lezcano/expRNN canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
Lezcano/geotorch community (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
get_lyap_exp Ran
ran on a synthesized input
Lezcano/geotorch/geotorch/hurwitz.py
code served (permissive licence) · get_code("78009faf06e73385")
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)

# Create a small matrix A for testing
# The function computes eigenvalues and returns the negative of the maximum real part
# A should be a square matrix
A = torch.randn(4, 4)

ARGS = {
    "A": A
}
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
get_parameters Ran
ran; our contract draft was wrong, not the code
Lezcano/expRNN/parametrization.py
code served (permissive licence) · get_code("93fa2cac3cbd6302")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple. 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 ConcreteParametrization(nn.Module):
    """Concrete implementation of Parametrization for testing"""
    def __init__(self, A, base, mode):
        # We need to call the parent __init__ but we'll implement it inline
        super(ConcreteParametrization, self).__init__()
        assert mode == 'static' or (isinstance(mode, tuple) and len(mode) == 3 and (mode[0] == 'dynamic'))
        self.A = nn.Parameter(A)
        self.register_buffer('_B', None)
        self.register_buffer('base', base)
        if mode == 'static':
            self.mode = mode
        else:
            self.mode = mode[0]
            self.K = mode[1]
            self.M = mode[2]
            self.k = 0
            self.m = 0

        def hook(grad):
            self._B = None
        self.A.register_hook(hook)

    def rebase(self):
        with torch.no_grad():
            self.base.data.copy_(self._B.data)
            self.A.data.zero_()

    @property
    def B(self):
        not_B = self._B is None
        if not_B or (not self._B.grad_fn and torch.is_grad_enabled()):
            self._B = self.retraction(self.A, self.base)
            self._B.requires_grad_()
            self._B.retain_grad()
            if self.mode == 'dynamic' and not_B:
                if self.k == 0:
                    self.rebase()
                    self.m = (self.m + 1) % self.M
                    if self.m == 0 and hasattr(self, 'project'):
                        with torch.no_grad():
                            self.base = self.project(self.base)
                if self.K != 'infty':
                    self.k = (self.k + 1) % self.K
                elif self.k == 0:
                    self.k = 1
        return self._B

    def retraction(self, A, base):
        return A + base

    def project(self, base):
        return base / (torch.norm(base) + 1e-8)

    def forward(self, input):
        return torch.matmul(input, self.B)

class TestModel(nn.Module):
    def __init__(self):
        super(TestModel, self).__init__()
        # Create a parametrized layer
        A1 = torch.randn(4, 3)
        base1 = torch.randn(4, 3)
        self.param_layer1 = ConcreteParametrization(A1, base1, 'static')
        
        # Create another parametrized layer with dynamic mode
        A2 = torch.randn(3, 5)
        base2 = torch.randn(3, 5)
        self.param_layer2 = ConcreteParametrization(A2, base2, ('dynamic', 10, 5))
        
        # Create a regular layer with unconstrained parameters
        self.linear = nn.Linear(5, 2)
        
        # Create another regular parameter
        self.bias = nn.Parameter(torch.randn(2))
    
    def forward(self, x):
        x = self.param_layer1(x)
        x = self.param_layer2(x)
        x = self.linear(x)
        x = x + self.bias
        return x

model = TestModel()

ARGS = {"model": model}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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
inv_scaled_sigmoid Ran
ran on a synthesized input
Lezcano/geotorch/geotorch/almostorthogonal.py
code served (permissive licence) · get_code("02208b0e975b51bb")
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 1, dtype family float, shape (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)

# The function inv_scaled_sigmoid takes a tensor t and applies operations on it
# It expects t to be a tensor that works with torch.atanh
# For atanh to work, values must be in the range (-1, 1)

# Create a small tensor with values in the valid range for atanh
t = torch.tensor([0.1, 0.2, -0.1, -0.2], dtype=torch.float32)

ARGS = {
    "t": t
}
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 1, dtype family float, shape (4,) — shape (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
inv_softplus_epsilon Ran
ran on a synthesized input
Lezcano/geotorch/geotorch/fixedrank.py
code served (permissive licence) · get_code("c053e1ab6c41e08b")
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, 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
import torch.nn as nn

torch.manual_seed(0)

# The function inv_softplus_epsilon takes two parameters:
# - x: a tensor (based on usage of .expm1(), .neg(), .log() which are tensor methods)
# - epsilon: a float with default value 1e-06

# Create a small tensor for x
x = torch.randn(2, 4)

# epsilon has a default value, but we'll provide it explicitly
epsilon = 1e-06

ARGS = {
    "x": x,
    "epsilon": epsilon,
}
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, 4) — shape (2, 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
scaled_sigmoid Ran
ran on a synthesized input
Lezcano/geotorch/geotorch/almostorthogonal.py
code served (permissive licence) · get_code("6cbf25c3b9bfbff1")
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, 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)

# The function scaled_sigmoid takes a single parameter 't' and applies
# torch.tanh(0.5 * t) to it. The parameter 't' should be a tensor.

t = torch.randn(2, 4)

ARGS = {
    "t": t
}
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, 4) — shape (2, 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
softplus_epsilon Ran
ran on a synthesized input
Lezcano/geotorch/geotorch/fixedrank.py
code served (permissive licence) · get_code("1e7ed992f256ebcb")
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, 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
import torch.nn.functional as F

torch.manual_seed(0)

# The function takes x and epsilon as parameters
# x should be a tensor that can be passed to torch.nn.functional.softplus
# epsilon is a scalar that gets added to the result

x = torch.randn(2, 4)
epsilon = 1e-06

ARGS = {
    "x": x,
    "epsilon": epsilon,
}
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, 4) — shape (2, 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
skew Not yet run
unverified (harvested, no recorded run)
Lezcano/geotorch/geotorch/constraints.py
code served (permissive licence) · get_code("06458292351e1172")
How it ran

no invocation recorded.

sphere Not yet run
unverified (harvested, no recorded run)
Lezcano/geotorch/geotorch/constraints.py
code served (permissive licence) · get_code("9a20e3ddc0e62b11")
How it ran

no invocation recorded.

symmetric Not yet run
unverified (harvested, no recorded run)
Lezcano/geotorch/geotorch/constraints.py
code served (permissive licence) · get_code("446a426848ccde8b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 8 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
get_parameters 1 other paper
1 later
1909.09501 (2019-09)
Trivializations for Gradient-Based Optimization on Manifolds

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

We introduce a novel approach to perform first-order optimization with orthogonal and unitary constraints. This approach is based on a parametrization stemming from Lie group theory through the exponential map. The parametrization transforms the constrained optimization problem into an unconstrained one over a Euclidean space, for which common first-order optimization methods can be used. The theoretical results presented are general enough to cover the special orthogonal group, the unitary group and, in general, any connected compact Lie group. We discuss how this and other parametrizations can be computed efficiently through an implementation trick, making numerically complex parametrizations usable at a negligible runtime cost in neural networks. In particular, we apply our results to RNNs with orthogonal recurrent weights, yielding a new architecture called expRNN. We demonstrate how our method constitutes a more robust approach to optimization with orthogonal constraints, showing faster, accurate, and more stable convergence in several tasks designed to test RNNs.

For agents

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

get_harvested_code_for_paper("1901.08428")
get_code_for_paper("1901.08428")
have("1901.08428")

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

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

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

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

Connect an agent — have() is free.