| BinaryToThermometer |
Ran ran on a synthesized input |
rohanshenoy/qkeras/qkeras/b2t.py code served (permissive licence) · get_code("c5da803484bb9815") How it ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 ranRan 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |