| abs_sq |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/numerics.py code served (permissive licence) · get_code("8c1ff079e1c251cf") 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 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import numpy as np
# Test with a real numpy array (real-valued)
real_array = np.array([1.0, 2.0, 3.0, 4.0])
# Test with a complex numpy array
complex_array = np.array([1.0 + 1.0j, 2.0 + 2.0j, 3.0 + 3.0j])
# Test with a jax array (real-valued)
jax_real_array = jnp.array([1.5, 2.5, 3.5, 4.5])
# Test with a jax array (complex-valued)
jax_complex_array = jnp.array([1.0 + 2.0j, 3.0 + 4.0j, 5.0 + 6.0j])
# Use the real numpy array as the primary test case
ARGS = {
"x": real_array
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| adabelief |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/alias.py code served (permissive licence) · get_code("52002c9d4813e1ec") 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 GradientTransformationExtraArgs. 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 jax
import jax.numpy as jnp
from optax._src import base
# Set seed for reproducibility
jax.config.update("jax_default_prng_impl", "threefry2x32")
# Create simple test parameters (a pytree of arrays)
params = {
'layer1': jnp.array([1.0, 2.0, 3.0, 4.0]),
'layer2': jnp.array([[0.1, 0.2], [0.3, 0.4], [0.5, 0.6], [0.7, 0.8]])
}
# Define learning rate as a scalar
learning_rate = 0.001
# Optional: define a weight decay mask function
def weight_decay_mask_fn(params):
# Return a pytree with same structure as params, with True/False leaves
return {
'layer1': True,
'layer2': False
}
# Construct arguments dictionary
ARGS = {
'learning_rate': learning_rate,
'b1': 0.9,
'b2': 0.999,
'eps': 1e-16,
'eps_root': 1e-16,
'weight_decay': None,
'weight_decay_mask': weight_decay_mask_fn,
'nesterov': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformationExtraArgs — a GradientTransformationExtraArgs output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformationExtraArgs output the recorded ndim 1 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
|
| adadelta |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/alias.py code served (permissive licence) · get_code("c1bf0f66f8ead4ab") 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 GradientTransformationExtraArgs. 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 jax
import jax.numpy as jnp
from optax._src import base
# Create simple parameters as a PyTree (dict of arrays)
params = {
'layer1': jnp.array([1.0, 2.0, 3.0, 4.0]),
'layer2': jnp.array([0.5, 1.5, 2.5, 3.5])
}
# Create a simple learning rate schedule (just a float works as fixed rate)
learning_rate = 0.01
# Rho parameter for Adadelta
rho = 0.9
# Epsilon for numerical stability
eps = 1e-6
# Weight decay parameter
weight_decay = 0.0
# Weight decay mask - None means apply to all parameters
# Could also be a function that returns a tree of booleans
weight_decay_mask = None
ARGS = {
'learning_rate': learning_rate,
'rho': rho,
'eps': eps,
'weight_decay': weight_decay,
'weight_decay_mask': weight_decay_mask
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformationExtraArgs — a GradientTransformationExtraArgs output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformationExtraArgs output the recorded ndim 1 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
|
| adafactor |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/alias.py code served (permissive licence) · get_code("be540cbd764c7d2a") 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 GradientTransformationExtraArgs. 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 jax
import jax.numpy as jnp
from optax._src import base
import optax
# Create test parameters as a simple JAX array
params = jnp.array([1.0, 2.0, 3.0, 4.0])
# Define all arguments for the adafactor function
ARGS = {
'learning_rate': 0.001,
'min_dim_size_to_factor': 128,
'decay_rate': 0.8,
'decay_offset': 0,
'multiply_by_parameter_scale': True,
'clipping_threshold': 1.0,
'momentum': None,
'dtype_momentum': jnp.float32,
'weight_decay_rate': None,
'eps': 1e-30,
'factored': True,
'weight_decay_mask': None,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformationExtraArgs — a GradientTransformationExtraArgs output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformationExtraArgs output the recorded ndim 1 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
|
| deprecation_getattr |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/deprecations.py code served (permissive licence) · get_code("46fa6da2a2e26515") 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 warnings
# Build a minimal deprecations dict
deprecations = {
'old_function': ('This function is deprecated, use new_function instead', lambda: 'replacement_value'),
'broken_function': ('This function no longer exists', None),
'another_deprecated': ('Deprecated since v2.0', lambda x: x * 2),
}
# Build module name
module_name = 'test_module'
ARGS = {
'module': module_name,
'deprecations': deprecations,
}
- 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 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
|
| global_norm |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/linear_algebra.py code served (permissive licence) · get_code("34f71acccac437e4") 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 ArrayImpl, 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
# Create a nested structure of JAX arrays to represent updates
# This mimics what would typically be gradients from a neural network
updates = {
'layer1': {
'weights': jnp.array([[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]]),
'bias': jnp.array([0.1, 0.2, 0.3, 0.4])
},
'layer2': {
'weights': jnp.array([[0.5, 1.5, 2.5, 3.5],
[4.5, 5.5, 6.5, 7.5]]),
'bias': jnp.array([0.01, 0.02, 0.03, 0.04])
}
}
ARGS = {
'updates': updates
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, 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
|
| init_empty_state |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/base.py code served (permissive licence) · get_code("6cb62843159b4e5e") 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 EmptyState. 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 jax
import jax.numpy as jnp
from typing import Union, Iterable, Mapping, Any
torch.manual_seed(0)
# Create various valid ArrayTree structures for Params
# ArrayTree = Union[ArrayLike, Iterable['ArrayTree'], Mapping[Any, 'ArrayTree']]
# Simple JAX array
simple_array = jnp.array([1.0, 2.0, 3.0, 4.0])
# Nested structure with list
nested_list = [jnp.array([1.0, 2.0]), jnp.array([3.0, 4.0, 5.0])]
# Nested structure with dict
nested_dict = {
'layer1': jnp.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
'layer2': jnp.array([7.0, 8.0])
}
# Complex nested structure
complex_tree = {
'encoder': [jnp.array([1.0, 2.0, 3.0, 4.0]), jnp.array([5.0, 6.0])],
'decoder': {
'weights': jnp.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]),
'biases': jnp.array([0.1, 0.2, 0.3])
}
}
# The function signature is:
# def init_empty_state(params: Params) -> EmptyState:
# The function only deletes params (doesn't use it) and returns EmptyState()
# So any valid Params will work
ARGS = {
'params': simple_array
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EmptyState — a EmptyState output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a EmptyState output the recorded ndim 1 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
|
| lookahead |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/lookahead.py code served (permissive licence) · get_code("f69cdcfdf348b5ba") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
import optax
from optax._src import base
# Create a simple fast optimizer (SGD)
fast_optimizer = optax.sgd(learning_rate=0.01)
# Define the lookahead function arguments
ARGS = {
'fast_optimizer': fast_optimizer,
'sync_period': 5,
'slow_step_size': 0.5,
'reset_state': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- absl, jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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
|
| matrix_inverse_pth_root |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/linear_algebra.py code served (permissive licence) · get_code("86e6aca17da03e77") 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 jax
import jax.numpy as jnp
import numpy as np
# Create a simple symmetric positive definite matrix
# Using a small 4x4 matrix for testing
np.random.seed(0)
A = np.random.randn(4, 4)
matrix = jnp.asarray(A @ A.T, dtype=jnp.float32)
# Parameters for the function
p = 2 # positive integer exponent
num_iters = 100
ridge_epsilon = 1e-06
error_tolerance = 1e-06
precision = jax.lax.Precision.HIGHEST
ARGS = {
"matrix": matrix,
"p": p,
"num_iters": num_iters,
"ridge_epsilon": ridge_epsilon,
"error_tolerance": error_tolerance,
"precision": precision,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy, optax — 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
|
| power_iteration |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/linear_algebra.py code served (permissive licence) · get_code("ed4ddeade9eb2eee") 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 jax
import jax.numpy as jnp
import jax.random
import optax.tree
from jax import lax
# Set seed for reproducibility
jax.config.update("jax_platform_name", "cpu")
# Test case 1: matrix as array with automatic v0 initialization
matrix_array = jnp.array([
[4.0, 1.0, 0.5],
[1.0, 3.0, 0.2],
[0.5, 0.2, 2.0]
], dtype=jnp.float32)
# Test case 2: matrix as callable (matrix-vector product function)
def matrix_callable(v):
"""Simple callable that implements matrix-vector product"""
return jnp.array([
4.0 * v[0] + 1.0 * v[1] + 0.5 * v[2],
1.0 * v[0] + 3.0 * v[1] + 0.2 * v[2],
0.5 * v[0] + 0.2 * v[1] + 2.0 * v[2]
])
# Initial vector for callable case
v0_tree = jnp.array([1.0, 0.5, 0.2], dtype=jnp.float32)
# Create ARGS dictionary with all parameters
ARGS = {
"matrix": matrix_array,
"v0": None,
"num_iters": 100,
"error_tolerance": 1e-06,
"precision": lax.Precision.HIGHEST,
"key": jax.random.PRNGKey(0),
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — 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
|
| safe_norm |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/numerics.py code served (permissive licence) · get_code("8446f6b71ea9fde1") 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 ArrayImpl, 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
# Set random seed for reproducibility
jax.random.PRNGKey(0)
# Create a small test vector
x = jnp.array([0.1, 0.2, 0.3, 0.4])
# Define minimum norm threshold
min_norm = jnp.array(0.5)
# Define the arguments dictionary
ARGS = {
"x": x,
"min_norm": min_norm,
"ord": None,
"axis": None,
"keepdims": False,
}
- 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 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
|
| safe_root_mean_squares |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/numerics.py code served (permissive licence) · get_code("b8071ff27a01c329") 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 ArrayImpl, 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 numpy as np
# Create test arguments for safe_root_mean_squares
x = jnp.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])
min_rms = jnp.array(0.5)
ARGS = {
'x': x,
'min_rms': min_rms,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, 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
|
| scale_by_backtracking_linesearch |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/linesearch.py code served (permissive licence) · get_code("e41730968a3fffcb") 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 GradientTransformationExtraArgs. 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 jax
import jax.numpy as jnp
import optax
ARGS = {
"max_backtracking_steps": 10,
"slope_rtol": 0.0001,
"decrease_factor": 0.8,
"increase_factor": 1.5,
"max_learning_rate": 1.0,
"atol": 0.0,
"rtol": 0.0,
"store_grad": False,
"verbose": False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformationExtraArgs — a GradientTransformationExtraArgs output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformationExtraArgs output the recorded ndim 1 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_by_factored_rms |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/factorized.py code served (permissive licence) · get_code("32fce6c5f1050dd1") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
import numpy as np
# Define the ARGS dictionary with all parameters for scale_by_factored_rms
ARGS = {
'factored': True,
'decay_rate': 0.8,
'step_offset': 0,
'min_dim_size_to_factor': 128,
'epsilon': 1e-30,
'decay_rate_fn': lambda i, exponent=0.8: 1.0 - (jnp.array(i + 1, jnp.float32) ** (-exponent))
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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_by_rms |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/transform.py code served (permissive licence) · get_code("0c22d7c2cc2a90d0") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
import optax
from optax._src import base
# Create simple parameter structure for testing
params = {
'layer1': jnp.ones((4, 3)),
'layer2': jnp.ones((2, 5))
}
# Define ARGS with all parameters for scale_by_rms
ARGS = {
'decay': 0.9,
'eps': 1e-8,
'initial_scale': 0.0,
'eps_in_sqrt': True,
'bias_correction': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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_by_rss |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/transform.py code served (permissive licence) · get_code("49a32735e1eb328a") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
import optax
from optax._src import base
# Create a simple parameter tree structure
params = {
'layer1': jnp.ones((4, 3)),
'layer2': jnp.ones((3, 2))
}
# Create gradient updates with same structure as params
updates = {
'layer1': jnp.ones((4, 3)) * 0.1,
'layer2': jnp.ones((3, 2)) * 0.1
}
# Define arguments for scale_by_rss function
ARGS = {
'initial_accumulator_value': 0.1,
'eps': 1e-07
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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_by_stddev |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/transform.py code served (permissive licence) · get_code("670803584425b73a") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
import optax
from optax._src import base
from optax._src import numerics
import optax.tree
ARGS = {
"decay": 0.9,
"eps": 1e-08,
"initial_scale": 0.0,
"eps_in_sqrt": True,
"bias_correction": False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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
|
| stateless |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/base.py code served (permissive licence) · get_code("08a168538fed09eb") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
from collections.abc import Callable
from typing import Optional
def create_simple_update_fn() -> Callable[[jax.typing.ArrayLike, Optional[jax.typing.ArrayLike]], jax.typing.ArrayLike]:
"""Create a simple update function that scales gradients."""
def f(updates, params=None):
# Simple stateless transformation: scale updates by 0.1
if isinstance(updates, dict):
return {k: v * 0.1 for k, v in updates.items()}
else:
return updates * 0.1
return f
ARGS = {
"f": create_simple_update_fn()
}
- 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 GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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
|
| stateless_with_tree_map |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/base.py code served (permissive licence) · get_code("8dcf52b4ebe33a4a") 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 GradientTransformation. 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 jax
import jax.numpy as jnp
def sample_update_fn(update_array, param_array=None):
"""Simple update function that scales updates by 0.1"""
return update_array * 0.1
# Create a simple function that takes an update array and optional param array
# and returns a transformed update array
def scaling_transform(update, param=None):
"""Scale updates by 0.1, optionally considering params"""
if param is not None:
return update * 0.1 * jnp.ones_like(param)
return update * 0.1
ARGS = {
'f': scaling_transform
}
- 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 GradientTransformation — a GradientTransformation output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GradientTransformation output the recorded ndim 1 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
|
| warn_deprecated_function |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/deprecations.py code served (permissive licence) · get_code("db7af5450cd8ac59") 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 functools
from typing import Any, Callable, Optional
import warnings
def warn_deprecated_function(fun: Callable[..., Any], replacement: Optional[str]=None, version_removed: Optional[str]=None) -> Callable[..., Any]:
"""A decorator to mark a function definition as deprecated.
Args:
fun: the deprecated function.
replacement: name of the function to be used instead.
version_removed: version of optax in which the function was/will be removed.
Returns:
The wrapped function.
Example usage:
>>> @functools.partial(warn_deprecated_function, replacement='g')
... def f(a, b):
... return a + b
"""
if hasattr(fun, '__name__'):
warning_message = f'The function {fun.__name__} is deprecated.'
else:
warning_message = 'The function is deprecated.'
if replacement:
warning_message += f' Please use {replacement} instead.'
if version_removed:
warning_message += f' This function will be/was removed in optax {version_removed}.'
@functools.wraps(fun)
def new_fun(*args, **kwargs):
warnings.warn(warning_message, category=DeprecationWarning, stacklevel=2)
return fun(*args, **kwargs)
return new_fun
# Define a simple deprecated function to pass as 'fun'
def old_function(x, y):
"""An old function that we want to deprecate."""
return x + y
# Define the arguments for warn_deprecated_function
ARGS = {
'fun': old_function,
'replacement': 'new_function',
'version_removed': '0.2.0'
}
- 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 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
|
| zoom_linesearch |
Ran ran on a synthesized input |
deepmind/optax/optax/_src/linesearch.py code served (permissive licence) · get_code("5760b69d788a57d7") 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 jax
import jax.numpy as jnp
import numpy as np
from typing import Optional
# Set seed for reproducibility
np.random.seed(0)
# Create small test arguments
ARGS = {
'max_linesearch_steps': 20,
'max_stepsize': 1.0,
'tol': 1e-6,
'increase_factor': 2.0,
'slope_rtol': 0.0001,
'curv_rtol': 0.9,
'approx_dec_rtol': 1e-6,
'interval_threshold': 1e-5,
'verbose': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy, optax — 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
|
| scale_by_zoom_linesearch |
Not yet run unverified (harvested, no recorded run) |
deepmind/optax/optax/_src/linesearch.py code served (permissive licence) · get_code("3fcd57975548149b") How it ran |