tessl install tessl/pypi-chex@0.1.0Comprehensive utilities library for JAX testing, debugging, and instrumentation
Agent Success
Agent success rate when using this tile
73%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.92x
Baseline
Agent success rate without this tile
38%
A utility for validating machine learning model outputs by comparing nested data structures with precise floating-point tolerance handling.
{"loss": 1.0, "accuracy": 0.95} and {"loss": 1.0, "accuracy": 0.95}, validation passes @test[1.0, 2.0, 3.0] and [1.0, 2.0, 3.0], validation passes @test{"metrics": [1.0, 2.0], "stats": {"mean": 1.5}} and {"metrics": [1.0, 2.0], "stats": {"mean": 1.5}}, validation passes @test{"a": 1.0} and {"b": 1.0}, validation fails with an informative error @test1.0 + 1e-15 and 1.0, with max_ulp=2, validation passes @test1.0 and 1.0 + 1e-14, with max_ulp=2, validation fails @test[1.0, 2.0, 3.0], validation passes with default tolerance @test{"layer1": {"weights": [1.0, 2.0]}, "layer2": {"bias": [0.5]}} and actual={"layer1": {"weights": [1.0 + 1e-15, 2.0]}, "layer2": {"bias": [0.5]}}, with max_ulp=10, validation passes @test[{"loss": 0.1}, {"loss": 0.2}] and actual=[{"loss": 0.1 + 1e-15}, {"loss": 0.2}], with max_ulp=5, validation passes @test@generates
def validate_outputs(expected, actual, max_ulp=1):
"""
Validates that two nested data structures are equivalent within floating-point tolerance.
Args:
expected: Expected output structure (nested dicts, lists, arrays)
actual: Actual output structure to validate
max_ulp: Maximum difference in Units in Last Place (ULP) for floating-point comparison
Raises:
ValueError: If structures don't match or values differ beyond tolerance
"""
passProvides tree comparison utilities with ULP-based floating-point precision handling.
@satisfied-by