File size: 1,627 Bytes
aab0192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
tasks/task_easy.py -- Easy task: 2 variables, low noise.

The agent must discover a single causal relationship between two abstract
variables in a low-noise setting with a generous budget.

Grader returns 0.0-1.0 based on:
  - Hypothesis accuracy (60%)
  - Efficiency bonus (20%)
  - Calibration (20%)
"""

from __future__ import annotations

from typing import Any

TASK_EASY = {
    "id": "easy",
    "name": "Easy -- Single-Edge Discovery",
    "description": (
        "Discover the causal relationship between two abstract variables. "
        "Low noise (sigma=0.05), generous budget (12 steps)."
    ),
    "difficulty": "easy",
    "reset_kwargs": {
        "noise_level": "low",
        "domain": "system_alpha",
        "seed": 42,
    },
}


def grade_easy(episode_result: dict[str, Any]) -> float:
    """
    Grade an easy-task episode. Returns a score in [0.0, 1.0].

    Args:
        episode_result: Dict containing at minimum:
            - accuracy_score (float): from the rubric
            - efficiency_bonus (float): from the rubric
            - calibration_score (float): from the rubric
            - total_episode_reward (float): sum of all rubric components

    Returns:
        Normalized score between 0.0 and 1.0.
    """
    accuracy = episode_result.get("accuracy_score", 0.0)
    efficiency = episode_result.get("efficiency_bonus", 0.0)
    calibration = episode_result.get("calibration_score", 0.0)

    raw = (
        0.60 * min(accuracy, 1.0)
        + 0.20 * min(efficiency / 0.15, 1.0)
        + 0.20 * min(calibration / 0.20, 1.0)
    )

    return round(max(0.0, min(1.0, raw)), 4)