SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.10159 · 2020

Automatic heterogeneous quantization of deep neural networks for low-latency inference on the edge for particle detectors

arXiv · PDF · Open in the Atlas

Code that ran

14 of 26 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 14 have no contract verdict; 0 failures of our instrument; 12 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/2006.10159.json · badge: /api/ran/2006.10159.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
rohanshenoy/qkeras community (classifier label)
classifier basis not recorded on the link
8 ran · 9 no recorded run
calad0i/HGQ community (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
FunctionStatusWhere it lives
BinaryToThermometer Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/b2t.py
code served (permissive licence) · get_code("c5da803484bb9815")
How it ran

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

import numpy as np
from tensorflow.keras.utils import to_categorical

# Create a small input array with values in range [0, 8)
# Shape: (2, 3, 4) - batch=2, height=3, width=4
x = np.array([
    [[0, 1, 2, 3],
     [4, 5, 6, 7],
     [0, 2, 4, 6]],
    [[1, 3, 5, 7],
     [0, 1, 2, 3],
     [4, 5, 6, 7]]
], dtype=np.float32)

ARGS = {
    'x': x,
    'classes': 2,
    'value_range': 8,
    'with_residue': False,
    'merge_with_channels': False,
    'use_two_hot_encoding': False,
}
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 ndarray, ndim 4, dtype family float, shape (2, 3, 4, 2) — shape (2, 3, 4, 2) 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
GetActivationSuffix Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qoctave.py
code served (permissive licence) · get_code("09398a22daae3b96")
How it ran

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

import re

def GetActivationSuffix(activation):
    """Returns suffix for layer name to facilitate debugging."""
    if not activation:
        return 'linear'
    if 'po2' in activation:
        return 'q2'
    elif 'quantized_relu' in activation:
        suffix = 'qr'
    elif 'quantized_tanh' in activation:
        suffix = 'qt'
    else:
        suffix = 'qb'
    numbers = re.findall('[0-9]+', activation)
    numbers = [n + '_' if len(n) > 1 else n for n in numbers]
    return suffix + ''.join(numbers)

ARGS = {
    'activation': 'quantized_relu_128_5'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
OctaveConv2D Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qoctave.py
code served (permissive licence) · get_code("4a20b411848af1c8")
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 function. 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

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

# Create minimal test input tensors
# Input should be a list of [x_h, x_l] where x_h is high freq and x_l is low freq
batch_size = 2
height_h = 8
width_h = 8
channels_h = 3

height_l = 4
width_l = 4
channels_l = 3

x_h = tf.random.normal((batch_size, height_h, width_h, channels_h))
x_l = tf.random.normal((batch_size, height_l, width_l, channels_l))

ARGS = {
    'filters': 16,
    'kernel_size': 3,
    'alpha': 0.5,
    'strides': (1, 1),
    'padding': 'same',
    'kernel_initializer': 'he_normal',
    'bias_initializer': 'zeros',
    'kernel_regularizer': None,
    'bias_regularizer': None,
    'kernel_constraint': None,
    'bias_constraint': None,
    'activation': 'relu',
    'use_separable': True,
    'name': 'octave_conv',
    'acc_quantizer': None,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
QAveragePooling2D Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qpooling.py
code served (permissive licence) · get_code("5b480cd73cbf0ae1")
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 function. 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

# Define a minimal quantizer class that has the interface expected
class MockQuantizer:
    """Minimal quantizer for testing purposes."""
    def __init__(self):
        self.name = "mock_quantizer"

# Define a minimal QActivation function/class for the quantizer
def QActivation(quantizer, name=None):
    """Minimal QActivation layer that accepts a quantizer."""
    class QActivationLayer(tf.keras.layers.Layer):
        def __init__(self, quantizer, name=None):
            super().__init__(name=name)
            self.quantizer = quantizer
        
        def call(self, x):
            # Just return x as-is for testing
            return x
    
    return QActivationLayer(quantizer, name=name)

# Create a small input tensor (batch=2, height=4, width=3, channels=1)
input_tensor = tf.keras.Input(shape=(4, 3, 1))

# Create a quantizer instance
quantizer_instance = MockQuantizer()

ARGS = {
    'pool_size': (2, 2),
    'strides': None,
    'padding': 'valid',
    'quantizer': quantizer_instance,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
QOctaveConv2D Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qoctave.py
code served (permissive licence) · get_code("51aca2e834d8e57b")
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 function. 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
from tensorflow.keras import layers
import numpy as np

# Mock the custom quantization layers that are referenced but not defined
class QConv2D(layers.Layer):
    def __init__(self, filters, kernel_size, strides=(1, 1), padding='valid', 
                 kernel_initializer='he_normal', bias_initializer='zeros',
                 kernel_regularizer=None, bias_regularizer=None,
                 kernel_constraint=None, bias_constraint=None,
                 kernel_quantizer=None, bias_quantizer=None,
                 kernel_range=1.0, bias_range=1.0, name='', **kwargs):
        super().__init__(name=name)
        self.filters = filters
        self.kernel_size = kernel_size

    def call(self, x):
        return x

class QSeparableConv2D(layers.Layer):
    def __init__(self, filters, kernel_size, strides=(1, 1), padding='valid',
                 depthwise_regularizer=None, depthwise_constraint=None,
                 depthwise_initializer='he_normal',
                 pointwise_regularizer=None, pointwise_constraint=None,
                 pointwise_initializer='he_normal',
                 bias_regularizer=None, bias_constraint=None,
                 bias_initializer='zeros',
                 depthwise_quantizer=None, pointwise_quantizer=None,
                 bias_quantizer=None, depthwise_activation=None,
                 pointwise_range=1.0, depthwise_range=1.0,
                 bias_range=1.0, name='', **kwargs):
        super().__init__(name=name)
        self.filters = filters

    def call(self, x):
        return x

class QActivation(layers.Layer):
    def __init__(self, activation, name='', **kwargs):
        super().__init__(name=name)
        self.activation = activation

    def call(self, x):
        return x

class QAveragePooling2D(layers.Layer):
    def __init__(self, pool_size=(2, 2), strides=None, padding='valid', name='', **kwargs):
        super().__init__(name=name)

    def call(self, x):
        return x

ARGS = {
    'filters': 32,
    'kernel_size': (3, 3),
    'alpha': 0.5,
    'strides': (1, 1),
    'padding': 'same',
    'kernel_initializer': 'he_normal',
    'bias_initializer': 'zeros',
    'kernel_regularizer': None,
    'bias_regularizer': None,
    'kernel_constraint': None,
    'bias_constraint': None,
    'use_separable': True,
    'name': 'octave_conv',
    'bias_quantizer': None,
    'kernel_quantizer': None,
    'depthwise_quantizer': None,
    'pointwise_quantizer': None,
    'acc_quantizer': 'quantized_relu_8',
    'pooling_quantizer': None,
    'depthwise_activation': None,
    'activation': 'quantized_relu_8',
    'bias_range': 1.0,
    'kernel_range': 1.0,
    'depthwise_range': 1.0,
    'pointwise_range': 1.0,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
RND Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/proxy/fixed_point_quantizer.py
code served (permissive licence) · get_code("c7c761fbe641c432")
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 as tf
import numpy as np

def RND(x):
    return tf.floor(x + 0.5)

# Create a small TensorFlow tensor to pass to RND
x_tensor = tf.constant([[1.3, 2.7, 3.2, 4.9],
                        [5.1, 6.4, 7.6, 8.2]], dtype=tf.float32)

ARGS = {
    "x": x_tensor
}
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
RND_CONV Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/proxy/fixed_point_quantizer.py
code served (permissive licence) · get_code("79068918a6559176")
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 as tf
import numpy as np

# Create a small TensorFlow tensor with distinct dimensions
x = tf.constant([[1.2, 2.5, 3.7, 4.1],
                 [5.3, 6.8, 7.2, 8.9]], dtype=tf.float32)

ARGS = {
    'x': x
}
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
TRN Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/proxy/fixed_point_quantizer.py
code served (permissive licence) · get_code("2230bec278fc10ac")
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 as tf
import numpy as np

def TRN(x):
    return tf.floor(x)

# Create a small TensorFlow tensor with float values
x = tf.constant([[1.2, 2.7, 3.1, 4.9], [5.3, 6.8, 7.2, 8.4]], dtype=tf.float32)

ARGS = {
    'x': x
}
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
activation_kif_forward Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/proxy/precision_derivation.py
code served (permissive licence) · get_code("1431e3fdf61bc841")
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 int; 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 numpy as np
from collections.abc import Callable

def dummy_activation(x):
    """A simple activation function that applies ReLU"""
    return np.maximum(x, 0)

def get_arr_container(arr: np.ndarray, silent=False):
    """ Get the minimal fixed integer that can represent the array (kif format). If the result is greater than ~30, consider that as inf. (Not representable by fixed point with reasonable bitwidth.)"""
    import warnings
    def warn(msg):
        warnings.warn(msg)
    
    k = arr < 0
    lf, hf = (-32, 32)
    if np.all(arr == 0):
        warn('All zero array is detected.')
        return (0, 1, 0)
    while True:
        if hf - lf <= 1:
            break
        f = (lf + hf) // 2
        _arr = arr * 2 ** f
        if np.all(_arr.astype(np.int64) == _arr):
            hf = f
        else:
            lf = f
    f = int(hf)
    if hf == 32 and (not silent):
        warn('Failed to derive fractional bits. Is the array really quantized with less than 32 fp bits?')
    with np.errstate(divide='ignore'):
        i1, i2 = (-np.inf, -np.inf)
        if (~k).any():
            i1 = np.floor(1 + np.log2(arr[~k] * 2.0 ** f)).max()
        if k.any():
            i2 = np.ceil(np.log2(-arr[k] * 2.0 ** f)).max()
        i = int(max(i1, i2))
    i -= f
    k = int(k.any())
    return (k, i, f)

def activation_kif_forward(func: Callable, k: int, i: int, f: int):
    """Given the input bitwidth (kif) of an activation function, get the output bitwidth (kif)."""
    if k + i + f <= 0:
        k = 0
        i = 1
        f = 0
    N = min(2 ** (k + i + f), 2 ** 20)
    arr = np.array(np.linspace(-2.0 ** i * k, 2.0 ** i - 2.0 ** (-f), N), dtype=np.float64)
    arr: np.ndarray = np.array(func(arr), dtype=np.float32)
    K, I, F = get_arr_container(arr, silent=True)
    return (K, I, F)

ARGS = {
    "func": dummy_activation,
    "k": 1,
    "i": 3,
    "f": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — 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
get_arr_container Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/proxy/precision_derivation.py
code served (permissive licence) · get_code("2b7074bd7febc4ce")
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 int; 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 numpy as np

# Create a simple test array with quantized values
# Using values that can be represented with fixed-point arithmetic
arr = np.array([
    [0.5, 1.25, -0.75, 2.125],
    [0.125, -1.5, 3.0, -2.25]
], dtype=np.float32)

ARGS = {
    "arr": arr,
    "silent": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — 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
get_auto_range_constraint_initializer Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qlayers.py
code served (permissive licence) · get_code("ea660d6b06041d4b")
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 numpy as np
import tensorflow as tf
from tensorflow.keras import initializers, constraints

# Create a minimal quantizer class that the function expects
class MockQuantizer:
    def __init__(self):
        self._max = 1.0
        self.bits = 8
    
    def max(self):
        return self._max
    
    def __call__(self, x):
        # Simple quantization: just return clipped values
        return np.clip(x, -self._max, self._max)

# Create instances for the arguments
quantizer = MockQuantizer()

# Create a constraint (can be None or a Keras constraint)
constraint = constraints.MaxNorm(max_value=1.0)

# Create an initializer
initializer = initializers.GlorotUniform()

# Build ARGS dictionary with all parameters for get_auto_range_constraint_initializer
ARGS = {
    'quantizer': quantizer,
    'constraint': constraint,
    'initializer': initializer
}
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 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
get_initializer Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/qlayers.py
code served (permissive licence) · get_code("0933ca9566b5853e")
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 GlorotUniform. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import six
from tensorflow.keras import initializers

# Create a minimal quantizer mock
class MockQuantizer:
    def __init__(self):
        self.bits = 8
        self._max = 1.0
    
    def max(self):
        return self._max
    
    def __call__(self, x):
        # Simple quantization mock
        return np.round(x * (2 ** self.bits)) / (2 ** self.bits)

# Create a minimal initializer
class MockInitializer:
    def __init__(self):
        self.scale = 1.0
    
    def __call__(self, shape, dtype=None):
        return np.random.randn(*shape).astype(dtype or np.float32) * 0.1

# Test cases for different identifier types
dict_identifier = {
    'class_name': 'glorot_uniform',
}

string_identifier = 'glorot_uniform'

callable_identifier = MockInitializer()

none_identifier = None

ARGS = {
    'identifier': dict_identifier
}
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 GlorotUniform — a GlorotUniform output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GlorotUniform 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
scale_grad Ran
ran on a synthesized input
calad0i/HGQ/src/HGQ/layers/base.py
code served (permissive licence) · get_code("1643f065017821aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 2, dtype family float, shape (2, 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

# Create small TensorFlow tensors for the function parameters
x = tf.constant([[1.0, 2.0, 3.0, 4.0],
                 [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

scale = tf.constant(0.5, dtype=tf.float32)

ARGS = {
    'x': x,
    'scale': scale
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 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
weight_compression Ran
ran on a synthesized input
rohanshenoy/qkeras/qkeras/codebook.py
code served (permissive licence) · get_code("6045502d0ac2cac6")
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 numpy as np
import torch
import torch.nn as nn
from sklearn.cluster import KMeans

torch.manual_seed(0)

# Create a small quantizer function that takes cluster centers and returns a tensor
class SimpleQuantizer(nn.Module):
    def forward(self, x):
        # Quantizer takes numpy array and returns a tensor
        return torch.from_numpy(x).float()

quantizer_fn = SimpleQuantizer()

# Create small weight matrix: shape (3, 4, 2) 
# axis=0 means we'll split along dimension 0, creating 3 weight matrices
weights = np.random.randn(3, 4, 2).astype(np.float32)

ARGS = {
    "weights": weights,
    "bits": 2,
    "axis": 0,
    "quantizer": quantizer_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch, tqdm — 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
activation_compression Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/codebook.py
code served (permissive licence) · get_code("8cb668d99317276e")
How it ran

no invocation recorded.

analyze_accumulator Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/estimate.py
code served (permissive licence) · get_code("137ccff456a7e506")
How it ran

no invocation recorded.

analyze_accumulator_from_sample Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/estimate.py
code served (permissive licence) · get_code("a82c2216301a1929")
How it ran

no invocation recorded.

convert_folded_layer_to_unfolded Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/bn_folding_utils.py
code served (permissive licence) · get_code("4fa726dc402437bf")
How it ran

no invocation recorded.

create_in_out_table Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/codebook.py
code served (permissive licence) · get_code("f2ab22c43ea69345")
How it ran

no invocation recorded.

get_constraint Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/qlayers.py
code served (permissive licence) · get_code("d4c926ba0d59d6b3")
How it ran

no invocation recorded.

get_input_kifs Not yet run
unverified (harvested, no recorded run)
calad0i/HGQ/src/HGQ/proxy/precision_derivation.py
code served (permissive licence) · get_code("83b44746819d42d2")
How it ran

no invocation recorded.

get_quant_mode Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/estimate.py
code served (permissive licence) · get_code("3a4328b7972bd589")
How it ran

no invocation recorded.

get_weight Not yet run
unverified (harvested, no recorded run)
calad0i/HGQ/src/HGQ/proxy/convert.py
code served (permissive licence) · get_code("9094378ccf4b5d24")
How it ran

no invocation recorded.

populate_bias_quantizer_from_accumulator Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/bn_folding_utils.py
code served (permissive licence) · get_code("65e79f2957133bfa")
How it ran

no invocation recorded.

trace_minmax Not yet run
unverified (harvested, no recorded run)
calad0i/HGQ/src/HGQ/bops/bops.py
code served (permissive licence) · get_code("85e95d8fcd9b7cbf")
How it ran

no invocation recorded.

unfold_model Not yet run
unverified (harvested, no recorded run)
rohanshenoy/qkeras/qkeras/bn_folding_utils.py
code served (permissive licence) · get_code("441e9baf5738fe1e")
How it ran

no invocation recorded.

Also present in other papers' code

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

Although the quest for more accurate solutions is pushing deep learning research towards larger and more complex algorithms, edge devices demand efficient inference and therefore reduction in model size, latency and energy consumption. One technique to limit model size is quantization, which implies using fewer bits to represent weights and biases. Such an approach usually results in a decline in performance. Here, we introduce a method for designing optimally heterogeneously quantized versions of deep neural network models for minimum-energy, high-accuracy, nanosecond inference and fully automated deployment on chip. With a per-layer, per-parameter type automatic quantization procedure, sampling from a wide range of quantizers, model energy consumption and size are minimized while high accuracy is maintained. This is crucial for the event selection procedure in proton-proton collisions at the CERN Large Hadron Collider, where resources are strictly limited and a latency of ${\mathcal O}(1)~μ$s is required. Nanosecond inference and a resource consumption reduced by a factor of 50 when implemented on field-programmable gate array hardware are achieved.

For agents

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

get_harvested_code_for_paper("2006.10159")
get_code_for_paper("2006.10159")
have("2006.10159")

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

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

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

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

Connect an agent — have() is free.