SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.07564 · 2024

Trainable Highly-expressive Activation Functions

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2407.07564.json · badge: /api/ran/2407.07564.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
bgu-cs-vil/ditac canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
R2 Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/regression_example/evaluation.py
code served (permissive licence) · get_code("add0d777b27172fa")
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)

# The function R2 expects:
# - y: a tensor with .cpu(), .detach(), .numpy() methods
# - y_pred: a tensor with .cpu(), .detach(), .numpy() methods
# Both should be convertible to numpy arrays for r2_score calculation

y = torch.randn(2, 4)
y_pred = torch.randn(2, 4)

ARGS = {
    'y': y,
    'y_pred': y_pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
RMSE Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/regression_example/evaluation.py
code served (permissive licence) · get_code("0088fd84030dee57")
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 float64, ndim 0, 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 torch
import numpy as np

torch.manual_seed(0)

# Create small tensors for y and y_pred
# The function expects tensors with .cpu(), .detach(), and .numpy() methods
y = torch.randn(2, 4)
y_pred = torch.randn(2, 4)

ARGS = {
    'y': y,
    'y_pred': y_pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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_loss Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/regression_example/evaluation.py
code served (permissive licence) · get_code("442198b32b497424")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for predictions and targets
y_pred = torch.randn(2, 4)  # batch_size=2, num_classes=4
y = torch.randint(0, 4, (2,))  # batch_size=2, class indices

# Create a loss function
loss_func = nn.CrossEntropyLoss()

ARGS = {
    "y_pred": y_pred,
    "y": y,
    "loss_func": loss_func,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_fast_transform_grid_eval Ran
ran on a synthesized input
bgu-cs-vil/ditac/ditac/utils/fast_cpab.py
code served (permissive licence) · get_code("97af7e6c82e34298")
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 method. 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)

def get_fast_transform_grid_eval(time=1.0, steps=2048):

    class Transformer_fast_gpu_closed_form_eval(torch.autograd.Function):

        @staticmethod
        def forward(ctx, grid, params, lingrid_t):
            if params.xmin == 0 and params.xmax == 1:
                quant_grid = grid * (steps - 1)
            else:
                quant_grid = (grid - params.xmin) * ((steps - 1) * (params.xmax - params.xmin))
            quant_grid = quant_grid.round().to(torch.long)
            grid_t = torch.nn.functional.embedding(quant_grid, lingrid_t.T).squeeze(-1)
            return grid_t
    return Transformer_fast_gpu_closed_form_eval().apply


class ParamsStandIn:
    def __init__(self, xmin, xmax):
        self.xmin = xmin
        self.xmax = xmax


# Create test inputs
grid = torch.rand(2, 4) * 0.5 + 0.25  # Shape: (2, 4), values in [0.25, 0.75]
params = ParamsStandIn(xmin=0, xmax=1)
lingrid_t = torch.randn(5, 2048)  # Shape: (5, 2048) - feature dimension x steps

# Get the apply function
transform_fn = get_fast_transform_grid_eval(time=1.0, steps=2048)

ARGS = {
    "time": 1.0,
    "steps": 2048
}
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 method — a method output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a method 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
get_precision_mat Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/ditac/utils/misc.py
code served (permissive licence) · get_code("1d87ab654455f87b")
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 (3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# D: int - dimensionality, number of centers
D = 4

# B: np.ndarray or torch.Tensor - matrix used in matmul operations
# Looking at the code: B is transposed, then matmul'd with cov_avees (which is DxD)
# and the result is matmul'd with B again
# So B should be (D x K) where K is some dimension
# Using K=3 to make it distinct from D=4
B = np.random.randn(4, 3).astype(np.float32)

# lambda_smooth: float - controls the gaussian kernel width
lambda_smooth = 0.5

# lambda_var: float - variance scaling parameter
lambda_var = 0.1

ARGS = {
    "D": D,
    "B": B,
    "lambda_smooth": lambda_smooth,
    "lambda_var": lambda_var,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (3, 3) — shape (3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
norm_data Ran
ran, honoured the contract we drafted
bgu-cs-vil/ditac/ditac/utils/misc.py
code served (permissive licence) · get_code("3b035cc02d994e08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - data: appears to be a numeric value or tensor that supports +, *, operations
# - origin_min, origin_max: numeric values representing original data range
# - target_min, target_max: numeric values representing target data range
# The function normalizes data from one range to another

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

# Define origin range (e.g., data naturally ranges from -2 to 2)
origin_min = -2.0
origin_max = 2.0

# Define target range (e.g., normalize to 0 to 1)
target_min = 0.0
target_max = 1.0

ARGS = {
    "data": data,
    "origin_min": origin_min,
    "origin_max": origin_max,
    "target_min": target_min,
    "target_max": target_max,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
phi Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/ditac/utils/misc.py
code served (permissive licence) · get_code("57b024a42d9d2520")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# The function phi takes a single parameter x and applies the error function
# x should be a tensor (based on torch.erf usage)
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to Ran
ran; our contract draft was wrong, not the code
bgu-cs-vil/ditac/ditac/utils/cpab_t.py
code served (permissive licence) · get_code("c40a4a89747caf9e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Test case 1: tensor input with default parameters
x_tensor = torch.randn(2, 4)

# Test case 2: list input
x_list = [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]]

# Test case 3: device as string
device_str = 'cpu'

# Test case 4: device as torch.device object
device_obj = torch.device('cpu')

ARGS = {
    'x': x_tensor,
    'dtype': torch.float32,
    'device': device_str
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

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

Nonlinear activation functions are pivotal to the success of deep neural nets, and choosing the appropriate activation function can significantly affect their performance. Most networks use fixed activation functions (e.g., ReLU, GELU, etc.), and this choice might limit their expressiveness. Furthermore, different layers may benefit from diverse activation functions. Consequently, there has been a growing interest in trainable activation functions. In this paper, we introduce DiTAC, a trainable highly-expressive activation function based on an efficient diffeomorphic transformation (called CPAB). Despite introducing only a negligible number of trainable parameters, DiTAC enhances model expressiveness and performance, often yielding substantial improvements. It also outperforms existing activation functions (regardless whether the latter are fixed or trainable) in tasks such as semantic segmentation, image generation, regression problems, and image classification. Our code is available at https://github.com/BGU-CS-VIL/DiTAC.

For agents

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

get_harvested_code_for_paper("2407.07564")
get_code_for_paper("2407.07564")
have("2407.07564")

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

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

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

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

Connect an agent — have() is free.