mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
feat(env): Isomorphic Strings Curriculum (#292)
* isomorphic strings curriculum --------- Co-authored-by: Andreas Köpf <andreas.koepf@xamla.com>
This commit is contained in:
parent
a7dd5f6680
commit
e69ed78c26
3 changed files with 65 additions and 8 deletions
|
|
@ -4,7 +4,11 @@ import json
|
|||
|
||||
import pytest
|
||||
|
||||
from reasoning_gym.algorithmic.isomorphic_strings import IsomorphicStringsConfig, IsomorphicStringsDataset
|
||||
from reasoning_gym.algorithmic.isomorphic_strings import (
|
||||
IsomorphicStringsConfig,
|
||||
IsomorphicStringsCurriculum,
|
||||
IsomorphicStringsDataset,
|
||||
)
|
||||
|
||||
|
||||
def test_isomorphic_strings_config_validation():
|
||||
|
|
@ -106,3 +110,24 @@ def test_isomorphic_strings_answer():
|
|||
"",
|
||||
)
|
||||
assert dataset._check_isomorphic(s, t) == True
|
||||
|
||||
|
||||
def test_isomorphic_strings_curriculum():
|
||||
curriculum = IsomorphicStringsCurriculum()
|
||||
|
||||
base_value = {"size": 150, "seed": 1}
|
||||
|
||||
base_cfg: IsomorphicStringsConfig = curriculum.generate_configuration(base_value)
|
||||
assert base_cfg.seed == 1
|
||||
assert base_cfg.size == 150
|
||||
assert base_cfg.min_string_length == 10 and base_cfg.max_string_length == 10
|
||||
|
||||
# test incrementing attribute levels
|
||||
curriculum.increment_attr_level("string_length")
|
||||
increased_cfg = curriculum.generate_configuration(base_value)
|
||||
assert increased_cfg.min_string_length == 10 and increased_cfg.max_string_length == 50
|
||||
|
||||
# test incrementing attribute levels again
|
||||
curriculum.increment_attr_level("string_length")
|
||||
increased_cfg = curriculum.generate_configuration(base_value)
|
||||
assert increased_cfg.min_string_length == 10 and increased_cfg.max_string_length == 100
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue