SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1503.05671 · 2015

Optimizing Neural Networks with Kronecker-factored Approximate Curvature

Roger Grosse, James Martens

arXiv · PDF · Open in the Atlas

Code that ran

48 of 82 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (20 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 1 violated it and 30 have no contract verdict; 12 failures of our instrument; 34 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/1503.05671.json · badge: /api/ran/1503.05671.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
tfjgeorge/nngeometry community
Papers with Code archive
17 ran · 10 no recorded run
tensorflow/kfac community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
gd-zhang/noisy-K-FAC community
Papers with Code archive
5 ran · 2 no recorded run
gpauloski/kfac_pytorch community
Papers with Code archive
4 ran · 8 no recorded run
alecwangcq/KFAC-Pytorch community
Papers with Code archive
4 ran · 1 no recorded run
lzhangbv/eva community
Papers with Code archive
4 ran · 1 no recorded run
deepmind/kfac-jax community (classifier label)
classifier basis not recorded on the link
3 ran · 3 no recorded run
pomonam/kronfluence community
Papers with Code archive
2 ran · 0 no recorded run
n-gao/pytorch-kfac community
Papers with Code archive
1 ran · 7 no recorded run
Thrandis/EKFAC-pytorch community
Papers with Code archive
1 ran · 0 no recorded run
Abdoulaye-Koroko/natural-gradients community
Papers with Code archive
0 ran · 2 no recorded run
FunctionStatusWhere it lives
Affine1dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("2ff2e376a2e4158e")
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, Affine1dLayer: 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
from functools import reduce
import operator

# Set seed for reproducibility
torch.manual_seed(0)

# The function is Affine1dLayer.__init__ which takes:
# - num_features: int
# - bias: bool (optional, defaults to True)

ARGS = {
    'num_features': 8,
    'bias': 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 Affine1dLayer — 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 Affine1dLayer 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
BaseTracker Ran
ran on a synthesized input · constructed an object; no result was computed
pomonam/kronfluence/kronfluence/module/tracker/factor.py
code served (permissive licence) · get_code("956d8974e23f92f3")
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, BaseTracker: 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
from torch import nn
from typing import List, Optional

torch.manual_seed(0)

class SimpleModule(nn.Module):
    """Minimal module for testing."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.name = "test_module"
    
    def forward(self, x):
        return self.linear(x)

# Create a simple module
module = SimpleModule()

ARGS = {
    "module": module
}
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 BaseTracker — 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 BaseTracker 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
BatchNorm1dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("10d89b5231aec8dd")
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, BatchNorm1dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class BatchNorm1dLayer(AbstractLayer):

    def __init__(self, num_features):
        self.num_features = num_features
        self.weight = Parameter(num_features)
        self.bias = Parameter(num_features)

    def numel(self):
        return self.weight.numel() + self.bias.numel()

    def __eq__(self, other):
        return self.num_features == other.num_features

torch.manual_seed(0)

ARGS = {
    'num_features': 4
}
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 BatchNorm1dLayer — 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 BatchNorm1dLayer 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
BatchNorm2dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("fac8035472c63fd0")
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, BatchNorm2dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class BatchNorm2dLayer(AbstractLayer):

    def __init__(self, num_features):
        self.num_features = num_features
        self.weight = Parameter(num_features)
        self.bias = Parameter(num_features)

    def numel(self):
        return self.weight.numel() + self.bias.numel()

    def __eq__(self, other):
        return self.num_features == other.num_features


torch.manual_seed(0)

ARGS = {
    'num_features': 64
}
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 BatchNorm2dLayer — 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 BatchNorm2dLayer 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
ComputeCovA Ran
ran on a synthesized input
alecwangcq/KFAC-Pytorch/optimizers/kfac.py
pointer only (licence: NONE) · get_code("6c5a83bcb01d90ef")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alecwangcq/KFAC-Pytorch 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.

ComputeCovG Ran
ran on a synthesized input
alecwangcq/KFAC-Pytorch/optimizers/kfac.py
pointer only (licence: NONE) · get_code("ef68f197dff83678")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alecwangcq/KFAC-Pytorch 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.

Conv1dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("35bc89f50dd7af53")
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, Conv1dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class Conv1dLayer(AbstractLayer):

    def __init__(self, in_channels, out_channels, kernel_size, bias=True):
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.kernel_size = kernel_size
        self.weight = Parameter(out_channels, in_channels, kernel_size[0])
        if bias:
            self.bias = Parameter(out_channels)
        else:
            self.bias = None

    def numel(self):
        if self.has_bias():
            return self.weight.numel() + self.bias.numel()
        else:
            return self.weight.numel()

    def __eq__(self, other):
        return self.in_channels == other.in_channels and self.out_channels == other.out_channels and (self.kernel_size == other.kernel_size)


ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': (5,),
    'bias': 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 Conv1dLayer — 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 Conv1dLayer 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
Conv2dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("6f1cfe87e0178123")
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, Conv2dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class Conv2dLayer(AbstractLayer):

    def __init__(self, in_channels, out_channels, kernel_size, bias=True):
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.kernel_size = kernel_size
        self.weight = Parameter(out_channels, in_channels, kernel_size[0], kernel_size[1])
        if bias:
            self.bias = Parameter(out_channels)
        else:
            self.bias = None

    def numel(self):
        if self.has_bias():
            return self.weight.numel() + self.bias.numel()
        else:
            return self.weight.numel()

    def __eq__(self, other):
        return self.in_channels == other.in_channels and self.out_channels == other.out_channels and (self.kernel_size == other.kernel_size)


ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': (3, 5),
    'bias': 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 Conv2dLayer — 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 Conv2dLayer 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
ConvTranspose2dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("a499441a745f94d9")
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, ConvTranspose2dLayer: 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 = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': (3, 5),
    'bias': 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 ConvTranspose2dLayer — 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 ConvTranspose2dLayer 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
Cosine1dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("3bbd96efbe01a300")
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, Cosine1dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class Cosine1dLayer(AbstractLayer):

    def __init__(self, in_features, out_features):
        self.in_features = in_features
        self.out_features = out_features
        self.weight = Parameter(out_features, in_features)
        self.bias = None

    def numel(self):
        return self.weight.numel()

    def __eq__(self, other):
        return self.in_features == other.in_features and self.out_features == other.out_features

torch.manual_seed(0)

ARGS = {
    'in_features': 4,
    'out_features': 3
}
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 Cosine1dLayer — 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 Cosine1dLayer 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
CovarianceTracker Ran
ran on a synthesized input · constructed an object; no result was computed
pomonam/kronfluence/kronfluence/module/tracker/factor.py
code served (permissive licence) · get_code("576826a57eb08cdf")
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, CovarianceTracker: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
from torch.utils.hooks import RemovableHandle
from typing import List, Optional, Union

torch.manual_seed(0)

# Define a minimal module that satisfies the interface expected by CovarianceTracker
class MinimalModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.name = "test_module"
        self.storage = {}
    
    def forward(self, x):
        return self.linear(x)

# Create an instance of the minimal module
module = MinimalModule()

# Create the ARGS dictionary with the required parameter
ARGS = {
    "module": module
}
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 CovarianceTracker — 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 CovarianceTracker 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
DummyGenerator Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("a477c7c01eaf05d4")
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, DummyGenerator: 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)

# DummyGenerator.__init__ takes:
# - device: a torch device

device = torch.device('cpu')

ARGS = {
    'device': device,
}
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 DummyGenerator — 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 DummyGenerator 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
EmbeddingLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("01151fe74bd4e116")
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, EmbeddingLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class EmbeddingLayer(AbstractLayer):
    transposed = True

    def __init__(self, num_embeddings, embedding_dim):
        self.num_embeddings = num_embeddings
        self.embedding_dim = embedding_dim
        self.weight = Parameter(num_embeddings, embedding_dim)

    def numel(self):
        return self.weight.numel()

    def __eq__(self, other):
        return self.num_embeddings == other.num_embeddings and self.embedding_dim == other.embedding_dim

torch.manual_seed(0)

ARGS = {
    'num_embeddings': 8,
    'embedding_dim': 4
}
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 EmbeddingLayer — 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 EmbeddingLayer 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
FVector Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("95bd77b76182deff")
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, FVector: 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)

# The FVector class takes a vector_repr parameter which should be a torch tensor
# based on how to_torch() uses it (returns self.vector_repr directly)
vector_repr = torch.randn(2, 4)

ARGS = {
    "vector_repr": vector_repr
}
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 FVector — 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 FVector 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
GroupNormLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("fab0128d2bc80b44")
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, GroupNormLayer: 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
from functools import reduce
import operator

torch.manual_seed(0)

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

ARGS = {
    'num_groups': 2,
    'num_channels': 4
}
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 GroupNormLayer — 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 GroupNormLayer 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
KFAC Ran
ran on a synthesized input · constructed an object; no result was computed
Thrandis/EKFAC-pytorch/kfac.py
code served (permissive licence) · get_code("ed328a08fd23b966")
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, KFAC: 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)

# Create a small network with Linear and Conv2d layers
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.linear1 = nn.Linear(4, 3)
        self.conv1 = nn.Conv2d(3, 2, kernel_size=3, padding=1)
        self.linear2 = nn.Linear(2, 2)
    
    def forward(self, x):
        # For linear layer
        if x.dim() == 2:
            return self.linear1(x)
        # For conv layer
        elif x.dim() == 4:
            return self.conv1(x)
        return x

net = SimpleNet()
net.train()

ARGS = {
    'net': net,
    'eps': 1e-4,
    'sua': False,
    'pi': False,
    'update_freq': 1,
    'alpha': 1.0,
    'constraint_norm': False,
}
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 KFAC — 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 KFAC 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
KFACOptimizer Ran
ran on a synthesized input · constructed an object; no result was computed
alecwangcq/KFAC-Pytorch/optimizers/kfac.py
pointer only (licence: NONE) · get_code("bd91cdd76a94bc85")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alecwangcq/KFAC-Pytorch 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.

LayerNormLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("f69b4478b2e83746")
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, LayerNormLayer: 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
from functools import reduce
import operator

torch.manual_seed(0)

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

ARGS = {
    'normalized_shape': (4, 3),
    'bias': 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 LayerNormLayer — 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 LayerNormLayer 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
LinearLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("b213da7adb946c6e")
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, LinearLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class LinearLayer(AbstractLayer):

    def __init__(self, in_features, out_features, bias=True):
        self.in_features = in_features
        self.out_features = out_features
        self.weight = Parameter(out_features, in_features)
        if bias:
            self.bias = Parameter(out_features)
        else:
            self.bias = None

    def numel(self):
        if self.has_bias():
            return self.weight.numel() + self.bias.numel()
        else:
            return self.weight.numel()

    def __eq__(self, other):
        return self.in_features == other.in_features and self.out_features == other.out_features


torch.manual_seed(0)

ARGS = {
    'in_features': 4,
    'out_features': 3,
    'bias': 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 LinearLayer — 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 LinearLayer 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
Lock Ran
ran on a synthesized input
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("f7fcbbda3360ca21")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned _GeneratorContextManager. 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 contextlib import contextmanager

class Lock(object):

    def __init__(self) -> None:
        self._entered: bool = False

    @contextmanager
    def __call__(self) -> None:
        assert not self._entered
        try:
            self._entered = True
            yield
        finally:
            self._entered = False

    def __bool__(self) -> bool:
        return self._entered


INIT_ARGS = {}

ARGS = {}

METHOD = '__call__'

lock = Lock(**INIT_ARGS)

with lock(**ARGS):
    assert lock._entered
    assert bool(lock)

assert not lock._entered
assert not bool(lock)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _GeneratorContextManager — a _GeneratorContextManager output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _GeneratorContextManager 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RMSNormLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("ebbc685253da02be")
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, RMSNormLayer: 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 operator
from functools import reduce

class Parameter(object):
    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class AbstractLayer:
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class RMSNormLayer(AbstractLayer):
    def __init__(self, normalized_shape):
        self.weight = Parameter(*normalized_shape)
        self.bias = None

    def numel(self):
        return self.weight.numel()

    def __eq__(self, other):
        return self.weight == other.weight

ARGS = {
    'normalized_shape': (4, 3)
}
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 RMSNormLayer — 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 RMSNormLayer 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
WeightNorm1dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("5f7fa87fab943a2f")
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, WeightNorm1dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class WeightNorm1dLayer(AbstractLayer):

    def __init__(self, in_features, out_features):
        self.in_features = in_features
        self.out_features = out_features
        self.weight = Parameter(out_features, in_features)
        self.bias = None

    def numel(self):
        return self.weight.numel()

    def __eq__(self, other):
        return self.in_features == other.in_features and self.out_features == other.out_features

torch.manual_seed(0)

ARGS = {
    'in_features': 4,
    'out_features': 3
}
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 WeightNorm1dLayer — 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 WeightNorm1dLayer 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
WeightNorm2dLayer Ran
ran on a synthesized input · constructed an object; no result was computed
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("140e25fc006243dc")
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, WeightNorm2dLayer: 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
from abc import ABC, abstractmethod
import operator
from functools import reduce

class AbstractLayer(ABC):
    transposed = False

    def __repr__(self):
        repr = f'{self.__class__}\n - weight = {self.weight}'
        if self.has_bias():
            return repr + f'\n - bias   = {self.bias}'
        else:
            return repr

    def has_bias(self):
        return hasattr(self, 'bias') and self.bias is not None

class Parameter(object):

    def __init__(self, *size):
        self.size = size

    def numel(self):
        return reduce(operator.mul, self.size, 1)

    def __eq__(self, other):
        return self.size == other.size

    def __repr__(self):
        return f'Parameter with shape {self.size}'

class WeightNorm2dLayer(AbstractLayer):

    def __init__(self, in_channels, out_channels, kernel_size):
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.kernel_size = kernel_size
        self.weight = Parameter(out_channels, in_channels, kernel_size[0], kernel_size[1])
        self.bias = None

    def numel(self):
        return self.weight.numel()

    def __eq__(self, other):
        return self.in_channels == other.in_channels and self.out_channels == other.out_channels and (self.kernel_size == other.kernel_size)


torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': (3, 5)
}
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 WeightNorm2dLayer — 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 WeightNorm2dLayer 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
_compute_pi_adjusted_damping Ran
ran; our contract draft was wrong, not the code
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("60eb09385fc152ec")
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 tensorflow as tf
import numpy as np

# Create small covariance matrices
# left_cov: shape (4, 4)
# right_cov: shape (3, 3)
left_cov = tf.constant([
    [1.0, 0.1, 0.0, 0.0],
    [0.1, 2.0, 0.0, 0.0],
    [0.0, 0.0, 3.0, 0.0],
    [0.0, 0.0, 0.0, 4.0]
], dtype=tf.float32)

right_cov = tf.constant([
    [1.5, 0.1, 0.0],
    [0.1, 2.5, 0.0],
    [0.0, 0.0, 3.5]
], dtype=tf.float32)

damping = 0.001

ARGS = {
    'left_cov': left_cov,
    'right_cov': right_cov,
    'damping': damping
}
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 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
_compute_pi_tracenorm Ran
ran; our contract draft was wrong, not the code
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("03bd0815719fb6ce")
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 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 tensorflow as tf
import numpy as np

# Create two covariance matrices with distinct shapes
# left_cov: 4x4 matrix
# right_cov: 3x3 matrix
left_cov = tf.constant([
    [2.0, 0.5, 0.1, 0.2],
    [0.5, 3.0, 0.3, 0.1],
    [0.1, 0.3, 1.5, 0.2],
    [0.2, 0.1, 0.2, 2.5]
], dtype=tf.float32)

right_cov = tf.constant([
    [1.5, 0.2, 0.1],
    [0.2, 2.0, 0.3],
    [0.1, 0.3, 1.2]
], dtype=tf.float32)

ARGS = {
    "left_cov": left_cov,
    "right_cov": right_cov
}
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 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
_extract_patches Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lzhangbv/eva/kfac/kfac.py
code served (permissive licence) · get_code("85b2fa0f8cf49ed9")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 5, 5, 27) 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)

# Create a small input tensor: (batch_size=2, in_c=3, h=5, w=5)
x = torch.randn(2, 3, 5, 5)

# Define kernel size as a tuple of two elements
kernel_size = (3, 3)

# Define stride as a tuple of two elements
stride = (1, 1)

# Define padding as a tuple of two elements
padding = (1, 1)

ARGS = {
    "x": x,
    "kernel_size": kernel_size,
    "stride": stride,
    "padding": padding,
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 4, dtype family float, shape (2, 5, 5, 27) — shape (2, 5, 5, 27) 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
append_homog Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/ops/fisher_factors.py
code served (permissive licence) · get_code("dae13d996f619373")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

# Create a simple 3D tensor with shape (2, 4, 5)
# This represents a batch of 2 samples, each with 4 spatial points in 5D space
tensor = tf.constant([
    [[1.0, 2.0, 3.0, 4.0, 5.0],
     [6.0, 7.0, 8.0, 9.0, 10.0],
     [11.0, 12.0, 13.0, 14.0, 15.0],
     [16.0, 17.0, 18.0, 19.0, 20.0]],
    [[21.0, 22.0, 23.0, 24.0, 25.0],
     [26.0, 27.0, 28.0, 29.0, 30.0],
     [31.0, 32.0, 33.0, 34.0, 35.0],
     [36.0, 37.0, 38.0, 39.0, 40.0]]
], dtype=tf.float32)

# homog_value can be None (uses default 1.0) or a specific scalar value
homog_value = None

ARGS = {
    "tensor": tensor,
    "homog_value": homog_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
broadcast_in_dim_equivalent Ran
ran, violated the contract we drafted
deepmind/kfac-jax/kfac_jax/_src/tag_graph_matcher.py
code served (permissive licence) · get_code("987e113518340066")
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 bool, 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 jax
import jax.numpy as jnp
import jax.extend as jex
from jax import core

# Create minimal JaxprEqn objects for broadcast_in_dim primitive
def create_broadcast_in_dim_eqn():
    """Create a minimal JaxprEqn for broadcast_in_dim primitive."""
    # Get the broadcast_in_dim primitive
    broadcast_in_dim_prim = core.Primitive.new_name('broadcast_in_dim')
    
    # Create input and output abstractions
    input_shape = (2, 3)
    output_shape = (2, 3, 4)
    
    # Create abstract values
    in_aval = core.ShapedArray(input_shape, jnp.float32)
    out_aval = core.ShapedArray(output_shape, jnp.float32)
    
    # Create variables for the equation
    in_var = core.Var(in_aval)
    out_var = core.Var(out_aval)
    
    # Create JaxprEqn with broadcast_in_dim primitive
    eqn = core.JaxprEqn(
        primitive=core.get_aval(jnp.broadcast_to(jnp.zeros(input_shape), output_shape)).__class__.__bases__[0],
        invars=[in_var],
        outvars=[out_var],
        params={}
    )
    
    return eqn

# Simpler approach: directly access existing primitives and create equations
def create_simple_jaxpr_eqn():
    """Create a JaxprEqn using actual JAX primitives."""
    # Use the actual broadcast_in_dim primitive from JAX
    from jax.interpreters import xla
    from jax.lib import xla_client
    
    # Create abstract input/output values
    in_aval = core.ShapedArray((2, 3), jnp.float32)
    out_aval = core.ShapedArray((2, 3, 4), jnp.float32)
    
    in_var = core.Var(in_aval)
    out_var = core.Var(out_aval)
    
    # Get the actual broadcast_in_dim primitive
    from jax.experimental.key_reuse import _check_key_reuse_count
    from jax._src.dtypes import preinit
    from jax.experimental import io_callback
    
    # Access primitive directly through core module
    prim = core.Primitive.new_name('broadcast_in_dim')
    prim.multiple_results = False
    
    eqn = core.JaxprEqn(
        primitive=prim,
        invars=[in_var],
        outvars=[out_var],
        params={'shape': (2, 3, 4), 'broadcast_dimensions': (0, 1)}
    )
    
    return eqn

# Most direct approach: construct minimal mock objects
class MockPrimitive:
    def __init__(self, name):
        self.name = name

class MockJaxprEqn:
    def __init__(self, prim_name):
        self.primitive = MockPrimitive(prim_name)

# Create the arguments
equation1 = MockJaxprEqn('broadcast_in_dim')
equation2 = MockJaxprEqn('broadcast_in_dim')

ARGS = {
    'equation1': equation1,
    'equation2': equation2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
compatible_sum Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
deepmind/kfac-jax/kfac_jax/_src/curvature_blocks/utils.py
code served (permissive licence) · get_code("dc1b986b1be917d4")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 1, 3, 5) 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 jax.numpy as jnp

# Create test tensors and parameters for compatible_sum function
tensor = jnp.ones((2, 4, 3, 5))  # 4D tensor with distinct dimensions
target_shape = (1, 3, 5)  # Target shape compatible with tensor
skip_axes = [0]  # Axes to skip during summation

ARGS = {
    "tensor": tensor,
    "target_shape": target_shape,
    "skip_axes": skip_axes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 1, 3, 5) — shape (2, 1, 3, 5) 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
compute_pi_adjusted_damping Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/ops/fisher_blocks.py
code served (permissive licence) · get_code("c9d2562d5cee3815")
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. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

class MockLinearOperator:
    """Mock LinearOperator that implements the minimal interface needed."""
    
    def __init__(self, domain_dim, trace_value):
        self._domain_dimension = domain_dim
        self._trace_value = trace_value
    
    @property
    def domain_dimension(self):
        return self._domain_dimension
    
    def trace(self):
        return tf.constant(self._trace_value, dtype=tf.float32)


# Create mock left and right covariance operators
# left_cov: domain_dimension=4, trace=2.0
# right_cov: domain_dimension=3, trace=1.5
left_cov = MockLinearOperator(domain_dim=4, trace_value=2.0)
right_cov = MockLinearOperator(domain_dim=3, trace_value=1.5)

# Create damping parameter
damping = tf.constant(0.1, dtype=tf.float32)

ARGS = {
    'left_cov': left_cov,
    'right_cov': right_cov,
    'damping': damping,
}
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 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
compute_pi_tracenorm Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/ops/fisher_blocks.py
code served (permissive licence) · get_code("2597244a6585acd2")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

class MockLinearOperator:
    """Mock LinearOperator with trace() and domain_dimension methods."""
    def __init__(self, trace_value, domain_dim):
        self._trace_value = trace_value
        self._domain_dim = domain_dim
    
    def trace(self):
        return tf.constant(self._trace_value, dtype=tf.float32)
    
    @property
    def domain_dimension(self):
        return self._domain_dim

left_cov = MockLinearOperator(trace_value=8.0, domain_dim=4)
right_cov = MockLinearOperator(trace_value=12.0, domain_dim=3)

ARGS = {
    "left_cov": left_cov,
    "right_cov": right_cov,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
eval_jaxpr_eqn Ran
ran; our contract draft was wrong, not the code
deepmind/kfac-jax/kfac_jax/_src/tag_graph_matcher.py
code served (permissive licence) · get_code("42474a82097165d1")
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, ndim 2, 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 jax
import jax.numpy as jnp
from jax import core
from jax.extend import core as jex_core
import jax.extend as jex

# Create a minimal Jaxpr equation for testing
# We'll use a simple primitive operation like addition

# Get the add primitive
add_prim = jax.lax.add_p

# Create minimal source info
class MockSourceInfo:
    def __init__(self):
        self.traceback = None

# Create a minimal JaxprEqn-like object
class MockJaxprEqn:
    def __init__(self):
        self.primitive = add_prim
        self.params = {}
        self.source_info = MockSourceInfo()
        self.invars = []
        self.outvars = []

# Construct the equation
eqn = MockJaxprEqn()

# Create input values - simple JAX arrays for addition
in_values = [
    jnp.array([1.0, 2.0, 3.0, 4.0]),
    jnp.array([5.0, 6.0, 7.0, 8.0])
]

ARGS = {
    'eqn': eqn,
    'in_values': in_values
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list 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
fill_triu Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("b4fe97f4f4ba63e8")
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) and returned Tensor, ndim 2, dtype family float, shape (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 symmetric matrix to extract the upper triangle from
# We'll create a 4x4 matrix and get its upper triangle
rows, cols = 4, 4
x = torch.randn(rows, cols)
x = (x + x.T) / 2  # Make it symmetric

# Get the upper triangle indices and extract the values
idxs = torch.triu_indices(rows, cols)
triu_values = x[idxs[0], idxs[1]]

ARGS = {
    "shape": (4, 4),
    "triu_tensor": triu_values,
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 2, dtype family float, shape (4, 4) — shape (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
get_factor_A Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lzhangbv/eva/kfac/kfac.py
code served (permissive licence) · get_code("0d56665a6e4fc981")
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 (6, 6) 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)

# For nn.Linear case
linear_layer = nn.Linear(5, 3, bias=True)
a_linear = torch.randn(2, 5)

# For nn.Conv2d case
conv_layer = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=True)
a_conv = torch.randn(2, 3, 8, 8)

ARGS = {
    "a": a_linear,
    "layer": linear_layer
}
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 (6, 6) — shape (6, 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
get_factor_G Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lzhangbv/eva/kfac/kfac.py
code served (permissive licence) · get_code("5d894a6e01e35d3c")
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 (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
import torch.nn as nn

torch.manual_seed(0)

# Test case 1: Linear layer
linear_layer = nn.Linear(3, 4)
g_linear = torch.randn(2, 4)

ARGS = {
    "g": g_linear,
    "layer": linear_layer
}
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 (4, 4) — shape (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
get_rank Ran
ran, honoured the contract we drafted
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("3278f8b9bebda5c0")
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) and returned int, ndim 0, dtype family int, 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
import torch.distributed as dist

torch.manual_seed(0)

# The function get_rank takes an optional ProcessGroup parameter
# Since distributed is not initialized in this test environment,
# we can pass None for the group parameter (which is the default)

ARGS = {
    "group": None
}
Setup block drafted by
a language model, Claude Haiku 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 int, ndim 0, dtype family int, 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_triu Ran
ran, honoured the contract we drafted
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("8ca46141b763e7bb")
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) and returned Tensor, ndim 1, dtype family float, shape (7,) 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 2D tensor with more columns than rows
# Shape: (2, 4) - 2 rows, 4 columns
tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 1, dtype family float, shape (7,) — shape (7,) 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_world_size Ran
ran, honoured the contract we drafted
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("1762f497470285d1")
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) and returned int, ndim 0, dtype family int, 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
import torch.distributed as dist

torch.manual_seed(0)

# The function get_world_size takes an optional ProcessGroup parameter
# When dist is not initialized, it returns 1 regardless of the group parameter
# When dist is initialized, it calls dist.get_world_size(group)

# Since we're in a non-distributed environment (no actual process group setup),
# the function will return 1. We can pass None or a ProcessGroup instance.
# For simplicity, we'll pass None since the function handles both cases.

ARGS = {
    "group": None
}
Setup block drafted by
a language model, Claude Haiku 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 int, ndim 0, dtype family int, 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
insert_slice_in_zeros Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/ops/loss_functions.py
code served (permissive licence) · get_code("75d2010849cfb391")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

# Disable v2 behavior for tf.compat.v1
tf.disable_v2_behavior()

# Create a simple slice tensor with shape where dim 0 has size 1
# Let's say we want a 4D tensor: (1, 3, 5, 2) where dim=0 has size 1
slice_to_insert = tf.constant(np.random.randn(1, 3, 5, 2), dtype=tf.float32)

# The dimension to expand with zeros
dim = 0

# The new size of that dimension
dim_size = 4

# The position where to insert the slice (0-indexed)
position = 1

ARGS = {
    "slice_to_insert": slice_to_insert,
    "dim": dim,
    "dim_size": dim_size,
    "position": position,
}
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 SymbolicTensor — a SymbolicTensor 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
kronecker Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("8f96d29b7dd6bd0b")
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 (6, 20) 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)

# Create two small 2D tensors for the Kronecker product
# A will be 2x4, B will be 3x5 (distinct dimensions for clarity)
A = torch.randn(2, 4)
B = torch.randn(3, 5)

ARGS = {
    "A": A,
    "B": B,
    "transpose": False
}
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 (6, 20) — shape (6, 20) 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
kronecker_product Ran
ran; our contract draft was wrong, not the code
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("7222c121f3477ba0")
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 (8, 15) 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

# Create two small matrices for the Kronecker product
# mat1 should be 2x3, mat2 should be 4x5 to get distinct dimensions
mat1 = tf.constant([[1.0, 2.0, 3.0],
                     [4.0, 5.0, 6.0]], dtype=tf.float32)

mat2 = tf.constant([[1.0, 2.0, 3.0, 4.0, 5.0],
                     [6.0, 7.0, 8.0, 9.0, 10.0],
                     [11.0, 12.0, 13.0, 14.0, 15.0],
                     [16.0, 17.0, 18.0, 19.0, 20.0]], dtype=tf.float32)

ARGS = {
    "mat1": mat1,
    "mat2": mat2
}
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 (8, 15) — shape (8, 15) 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
layer_params_to_mat2d Ran
ran, honoured the contract we drafted
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("91a213d003b54394")
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 (7, 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)

# Case 1: vector as a single tensor with shape (batch, output_dim)
# We need a tensor that can be reshaped to [-1, output_dim]
# Shape: (2, 3, 4) where 4 is the output dimension
single_vector = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

# Case 2: vector as a tuple of (weights, bias)
# weights shape: (2, 3, 4) where 4 is output dimension
# bias shape: (4,)
w_part = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))
b_part = tf.constant(np.random.randn(4).astype(np.float32))
vector_tuple = (w_part, b_part)

# Use the tuple case as it exercises more of the function
ARGS = {
    "vector": vector_tuple
}
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 (7, 4) — shape (7, 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
mat2d_to_layer_params Ran
ran, honoured the contract we drafted
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("644afb931715ec36")
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. 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 tensorflow as tf
import numpy as np

# Case 1: vector_template is a tuple of tensors (weights and bias)
w_template = tf.constant(np.random.randn(4, 3).astype(np.float32))
b_template = tf.constant(np.random.randn(3).astype(np.float32))
vector_template_tuple = (w_template, b_template)

# Create mat2d that matches the shape from layer_params_to_mat2d
# If vector_template is (w, b), mat2d should have shape (4+1, 3)
# where first 4 rows are w reshaped, and last row is b
mat2d_tuple = tf.constant(np.random.randn(5, 3).astype(np.float32))

# Case 2: vector_template is a single tensor
vector_template_single = tf.constant(np.random.randn(4, 3).astype(np.float32))
mat2d_single = tf.constant(np.random.randn(4, 3).astype(np.float32))

# Use the tuple case for ARGS
ARGS = {
    "vector_template": vector_template_tuple,
    "mat2d": mat2d_tuple
}
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 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
mat_inv Ran
ran; our contract draft was wrong, not the code
lzhangbv/eva/kfac/kfac.py
code served (permissive licence) · get_code("0ce2b352cc049e18")
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) and returned Tensor, ndim 2, dtype family float, shape (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)

# mat_inv expects a square matrix that is positive definite
# so that torch.linalg.cholesky can decompose it
# Create a small positive definite matrix by constructing A^T @ A
A = torch.randn(4, 4)
x = A.T @ A  # This ensures x is symmetric positive definite

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 2, dtype family float, shape (4, 4) — shape (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
normalize_damping Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/ops/fisher_blocks.py
code served (permissive licence) · get_code("51a29ce1d20b6e08")
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 float, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - damping: used in division, so numeric (int or float)
# - num_replications: used in exponentiation and division, so numeric (int or float)
# The function performs: damping / num_replications ** NORMALIZE_DAMPING_POWER

ARGS = {
    "damping": 10.0,
    "num_replications": 4
}
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 float, 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
serialize_fisher_approx Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/keras/utils.py
code served (permissive licence) · get_code("9682f590ed4212ee")
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 torch
import six

torch.manual_seed(0)

# The function serialize_fisher_approx takes a fisher_approx parameter
# which can be either a dict or a list (based on isinstance checks)
# If it's a dict, it serializes the keys using the serialize helper function
# Keys can be either strings or classes (it checks isinstance(key, six.string_types))

# Create a simple class to use as a non-string key
class CustomFisherClass:
    pass

class AnotherFisherClass:
    pass

# Test case 1: dict with string keys and numeric values
fisher_dict_strings = {
    'layer1': 0.5,
    'layer2': 0.3,
}

# Test case 2: dict with class keys and numeric values
fisher_dict_classes = {
    CustomFisherClass: 0.7,
    AnotherFisherClass: 0.2,
}

# Test case 3: dict with mixed string and class keys
fisher_dict_mixed = {
    'layer1': 0.5,
    CustomFisherClass: 0.3,
}

# Test case 4: list (should pass through unchanged)
fisher_list = [0.1, 0.2, 0.3]

# Use the dict with string keys as the main test case
ARGS = {
    'fisher_approx': fisher_dict_strings
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
six, 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
serialize_loss Ran
ran on a synthesized input
tensorflow/kfac/kfac/python/keras/utils.py
code served (permissive licence) · get_code("da37ff58ebeb1932")
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 six
import tensorflow.compat.v1 as tf
import numpy as np

losses = tf.keras.losses

# Test case 1: None input
loss_none = None

# Test case 2: String input
loss_string = "mse"

# Test case 3: Dict with string and loss object values
loss_dict = {
    "loss1": "mse",
    "loss2": losses.MeanSquaredError()
}

# Test case 4: List with string and loss object values
loss_list = [
    "mae",
    losses.MeanAbsoluteError(),
    "crossentropy"
]

# Test case 5: Loss object directly
loss_object = losses.CategoricalCrossentropy()

# Test case 6: Empty string
loss_empty_string = ""

ARGS = {
    "loss": loss_object
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, six, tensorflow — 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
try_contiguous Ran
ran; our contract draft was wrong, not the code
alecwangcq/KFAC-Pytorch/optimizers/kfac.py
pointer only (licence: NONE) · get_code("a485499e9e91edac")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alecwangcq/KFAC-Pytorch 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.

AbstractLayer Not yet run
unverified (harvested, no recorded run)
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("35284deabd2168da")
How it ran

no invocation recorded.

AdjointMixin Not yet run
unverified (harvested, no recorded run)
tfjgeorge/nngeometry/nngeometry/object/pspace.py
code served (permissive licence) · get_code("2041a0308d51063e")
How it ran

no invocation recorded.

AllreduceMethod Not yet run
unverified (harvested, no recorded run)
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("1b60c10748712a31")
How it ran

no invocation recorded.

AllreduceTensorBucket Not yet run
unverified (harvested, no recorded run)
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("2b1c0c841481916b")
How it ran

no invocation recorded.

BaseKFACPreconditioner Not yet run
unverified (harvested, no recorded run)
gpauloski/kfac_pytorch/kfac/base_preconditioner.py
code served (permissive licence) · get_code("0d8033af1549fa2c")
How it ran

no invocation recorded.

BaseOptimizer Not yet run
unverified (harvested, no recorded run)
Abdoulaye-Koroko/natural-gradients/optimizers/kfac.py
pointer only (licence: NONE) · get_code("c03b72239a4f4bcb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Abdoulaye-Koroko/natural-gradients 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. No invocation recorded.

ConvFisherBlock Not yet run
unverified (harvested, no recorded run)
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("7500eb60962601d5")
How it ran

no invocation recorded.

ExtensionFisherBlock Not yet run
unverified (harvested, no recorded run)
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("173f7a31889b7f5f")
How it ran

no invocation recorded.

FisherBlock Not yet run
unverified (harvested, no recorded run)
gd-zhang/noisy-K-FAC/ops/fisher_blocks.py
code served (permissive licence) · get_code("5a78d2378b246eb6")
How it ran

no invocation recorded.

FisherBlock Not yet run
unverified (harvested, no recorded run)
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("b57f5f260d76a226")
How it ran

no invocation recorded.

FullyConnectedFisherBlock Not yet run
unverified (harvested, no recorded run)
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("8bec7b9650c29e3e")
How it ran

no invocation recorded.

Identity Not yet run
unverified (harvested, no recorded run)
n-gao/pytorch-kfac/torch_kfac/kfac_optimizer.py
code served (permissive licence) · get_code("16eaade9680fa2ad")
How it ran

no invocation recorded.

Showing the first 60. An agent gets every one from get_harvested_code_for_paper("1503.05671").

Also present in other papers' code

Of 82 samples lifted from this paper's linked repositories, 82 carry a function identity and 0 do not. Of the 82 distinct functions with an identity, 8 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 8 later) and 74 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
try_contiguous
brick of this paper's assembly: helper
3 other papers
3 later
2007.00784 (2020-07)
Convolutional Neural Network Training with Distributed K-FAC
2306.01685 (2023-06)
MKOR: Momentum-Enabled Kronecker-Factor-Based Optimizer Using Rank-1 Updates
2605.18591 (2026-05)
Randomized Advantage Transformation (RAT): Computing Natural Policy Gradients via Direct Backpropagation
broadcast_in_dim_equivalent 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
compatible_sum 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
eval_jaxpr_eqn 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
get_and_verify_loss_meta 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
get_loss_outputs 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
reshape_equivalent 2 other papers
2 later
2203.08120 (2022-03)
Deep Learning without Shortcuts: Shaping the Kernel with Tailored Rectifiers
2605.26248 (2026-05)
Unified Neural Scaling Laws
_extract_patches
brick of this paper's assembly: helper
1 other paper
1 later
2306.01685 (2023-06)
MKOR: Momentum-Enabled Kronecker-Factor-Based Optimizer Using Rank-1 Updates

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 propose an efficient method for approximating natural gradient descent in neural networks which we call Kronecker-factored Approximate Curvature (K-FAC). K-FAC is based on an efficiently invertible approximation of a neural network's Fisher information matrix which is neither diagonal nor low-rank, and in some cases is completely non-sparse. It is derived by approximating various large blocks of the Fisher (corresponding to entire layers) as being the Kronecker product of two much smaller matrices. While only several times more expensive to compute than the plain stochastic gradient, the updates produced by K-FAC make much more progress optimizing the objective, which results in an algorithm that can be much faster than stochastic gradient descent with momentum in practice. And unlike some previously proposed approximate natural-gradient/Newton methods which use high-quality non-diagonal curvature matrices (such as Hessian-free optimization), K-FAC works very well in highly stochastic optimization regimes. This is because the cost of storing and inverting K-FAC's approximation to the curvature matrix does not depend on the amount of data used to estimate it, which is a feature typically associated only with diagonal or low-rank approximations to the curvature matrix.

For agents

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

get_harvested_code_for_paper("1503.05671")
get_code_for_paper("1503.05671")
have("1503.05671")

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

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

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

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

Connect an agent — have() is free.