mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
Basic curriculum (#198)
* feat: Add optional curriculum support to dataset registration and creation * docs: Add docstrings to create_curriculum() and register_dataset() * feat: Add curriculum configuration classes for CurriculumExperiment * feat: Add weight parameter to CurriculumAttributeConfig and use in DatasetSpec * refactor: Simplify CurriculumAttributeConfig with "*" attribute level support * test: Add unit tests for CurriculumExperiment class * feat: Add from_yaml() method to CurriculumExperimentConfig with unit test
This commit is contained in:
parent
cbfdf097a0
commit
c69bc5d4e6
29 changed files with 943 additions and 63 deletions
|
|
@ -4,6 +4,9 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from reasoning_gym.coaching.attributes import AttributeType, RangeAttributeDefinition
|
||||
from reasoning_gym.coaching.base_curriculum import BaseCurriculum
|
||||
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
ANIMALS = {
|
||||
|
|
@ -124,4 +127,23 @@ class LegCountingDataset(ProceduralDataset):
|
|||
}
|
||||
|
||||
|
||||
register_dataset("leg_counting", LegCountingDataset, LegCountingConfig)
|
||||
class LegCountingCurriculum(BaseCurriculum):
|
||||
def __init__(self):
|
||||
super().__init__(LegCountingCurriculum.__name__, LegCountingConfig)
|
||||
|
||||
# Define attributes
|
||||
self._define_attributes(
|
||||
RangeAttributeDefinition(
|
||||
name="num_animals",
|
||||
levels=list(range(1, 20)),
|
||||
default_level=0, # Start with 2 terms
|
||||
description="Number of animals in question",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1, # Ensure at least 1 animal
|
||||
lower_field_name="min_animals",
|
||||
upper_field_name="max_animals",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
register_dataset("leg_counting", LegCountingDataset, LegCountingConfig, LegCountingCurriculum)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue