Download scripts/baseline_random.py from ArnavM10/rl-env-2605.07119-classification-fields: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/spaces/ArnavM10/rl-env-2605.07119-classification-fields/resolve/main/scripts/baseline_random.py
- Command line
-
hf download hf://spaces/ArnavM10/rl-env-2605.07119-classification-fields/scripts/baseline_random.py
-
curl -L -o baseline_random.py https://huggingface.co/spaces/ArnavM10/rl-env-2605.07119-classification-fields/resolve/main/scripts/baseline_random.py
1.74 kB
| # Random baseline for the Classification Fields RL environment | |
| # (arXiv:2605.07119). Gets LOW reward (~0). | |
| # | |
| # Strategy: submit a uniformly random Table 1 without ever running the | |
| # reproduction. Because the acceptance windows are the paper's 2-sigma | |
| # tolerances on six independent cells plus the verdict, a random table earns | |
| # essentially zero reward in expectation. | |
| # | |
| # Usage: | |
| # python scripts/baseline_random.py --base-url http://localhost:8000 | |
| import argparse | |
| import random | |
| import sys | |
| from classification_fields_env import CallToolAction, ClassificationFieldsEnv | |
| def main() -> int: | |
| parser = argparse.ArgumentParser( | |
| description=( | |
| "Random baseline for Table 1 reproduction of arXiv:2605.07119 " | |
| "(Classification Fields, nonlinear IFS benchmarks)." | |
| ) | |
| ) | |
| parser.add_argument("--base-url", required=True) | |
| parser.add_argument("--seed", type=int, default=0) | |
| args = parser.parse_args() | |
| rng = random.Random(args.seed) | |
| with ClassificationFieldsEnv(base_url=args.base_url).sync() as env: | |
| env.reset() | |
| cells = { | |
| benchmark: {"cfp": rng.uniform(0.0, 500.0), "affine": rng.uniform(0.0, 500.0)} | |
| for benchmark in ("sierpinski", "cantor_dust", "koch_curve") | |
| } | |
| step = env.step( | |
| CallToolAction( | |
| tool_name="submit_table", | |
| arguments={ | |
| "verdict": rng.choice( | |
| ["cfp_wins_all_three", "affine_wins_all_three", "mixed_or_unclear"] | |
| ), | |
| "cells": cells, | |
| }, | |
| ) | |
| ) | |
| print(f"reward: {step.reward}") | |
| return 0 | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |