mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
Refactor Curriculum Attributes (#335)
* remove min_value from AttributeDefinition * remove type from AttributeDefinition * Add CurriculumContext * add ensure_interval option for RangeAttributes * docs: Add legend explaining curriculum indicators in dataset gallery * update GALLERY.md
This commit is contained in:
parent
4e7d9296ee
commit
d2c895f1d3
101 changed files with 286 additions and 677 deletions
|
|
@ -2,7 +2,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -152,10 +152,7 @@ class ABCurriculum(BaseCurriculum):
|
|||
name="length",
|
||||
field_name="length",
|
||||
levels=[1, 10, 50, 100],
|
||||
default_level=0,
|
||||
description="Length of the A::B program",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=1,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Your task is to convert a number between two different bases.
|
||||
|
|
@ -126,22 +126,18 @@ class BaseConversionCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="base",
|
||||
levels=[2, 9, 18, 27, 36],
|
||||
default_level=1,
|
||||
description="The base of the number system",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_base",
|
||||
upper_field_name="max_base",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="value",
|
||||
levels=[1_000, 10_000, 100_000, 1_000_000],
|
||||
default_level=0,
|
||||
description="The value to convert",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_value",
|
||||
upper_field_name="max_value",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a binary string, return the minimum number of character swaps to make it alternating, or -1 if it is impossible.
|
||||
|
|
@ -122,10 +122,7 @@ class BinaryAlternationCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[10, 50, 500, 1000],
|
||||
default_level=0,
|
||||
description="Number of bits in the binary string",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a square matrix, your job is to find the taxicab (Manhattan) distance of the nearest 0 for each cell.
|
||||
|
|
@ -147,18 +147,12 @@ class BinaryMatrixCurriculum(BaseCurriculum):
|
|||
name="p_zero",
|
||||
field_name="p_zero",
|
||||
levels=[0.5, 0.25, 0.1, 0.05],
|
||||
default_level=0,
|
||||
description="Board size",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=0,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[10, 50, 250, 1000],
|
||||
default_level=0,
|
||||
description="Board size",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import read_data_file
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -98,18 +98,14 @@ class CaesarCipherCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="rotation",
|
||||
levels=[5, 10, 15, 25],
|
||||
default_level=0,
|
||||
description="Max rotation for cipher",
|
||||
attr_type=AttributeType.APPEND,
|
||||
lower_field_name="min_rotation",
|
||||
upper_field_name="max_rotation",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="words",
|
||||
levels=[5, 10, 15, 25],
|
||||
default_level=0,
|
||||
description="Max number of words",
|
||||
attr_type=AttributeType.APPEND,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Count how many prime numbers there are between {start} and {end} (inclusive) ?"""
|
||||
|
|
@ -80,10 +80,7 @@ class CountPrimesCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[1000, 10_000, 50_000, 100_000],
|
||||
default_level=0,
|
||||
description="Up to which number to consider the primes",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -253,12 +253,10 @@ class CryptarithmCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="words",
|
||||
levels=[2, 5, 10, 50],
|
||||
default_level=1,
|
||||
description="Number of words in the cryptarithm puzzle",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
ensure_interval=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from typing import Any, Optional
|
|||
|
||||
import cellpylib as cpl
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -163,38 +163,26 @@ class GameOfLifeCurriculum(BaseCurriculum):
|
|||
name="grid_size_x",
|
||||
field_name="grid_size_x",
|
||||
levels=[10, 100, 500, 999],
|
||||
default_level=0,
|
||||
description="Grid size in the x direction",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=10,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="grid_size_y",
|
||||
field_name="grid_size_y",
|
||||
levels=[10, 100, 500, 999],
|
||||
default_level=0,
|
||||
description="Grid size in the y direction",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=-10,
|
||||
),
|
||||
# Filled cells should be 10%, 20%, 30%, 50% of the grid_size_x * grid_size_y
|
||||
ScalarAttributeDefinition(
|
||||
name="filled_cells_weights",
|
||||
field_name="filled_cells_weights",
|
||||
levels=[0.1, 0.2, 0.5, 0.8],
|
||||
default_level=0,
|
||||
description="Percentage of filled cells in the grid",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=0.1,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="simulation_steps",
|
||||
field_name="simulation_steps",
|
||||
levels=[1, 2, 5, 10],
|
||||
default_level=0,
|
||||
description="Number of simulation steps to run",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=1,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from typing import Dict, List, Optional
|
|||
|
||||
import cellpylib as cpl
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -402,46 +402,31 @@ class GameOfLifeHaltingCurriculum(BaseCurriculum):
|
|||
name="grid_size_x",
|
||||
field_name="grid_size_x",
|
||||
levels=[12, 25, 50, 200],
|
||||
default_level=0,
|
||||
description="Grid size in the x direction",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=12,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="grid_size_y",
|
||||
field_name="grid_size_y",
|
||||
levels=[12, 25, 50, 200],
|
||||
default_level=0,
|
||||
description="Grid size in the y direction",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=12,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="difficulty",
|
||||
field_name="difficulty",
|
||||
levels=[1, 2, 3],
|
||||
default_level=0,
|
||||
description="Oscillator type difficulty",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=1,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="num_oscillators",
|
||||
field_name="num_oscillators",
|
||||
levels=[3, 7, 10, 20],
|
||||
default_level=0,
|
||||
description="Number of oscillators to place",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=3,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="max_simulation_steps",
|
||||
field_name="max_simulation_steps",
|
||||
levels=[20, 50, 100, 200],
|
||||
default_level=0,
|
||||
description="Number of simulation steps to query",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=20,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -255,10 +255,7 @@ class GraphColorCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="num_vertices",
|
||||
levels=[10, 20, 25, 50],
|
||||
default_level=0,
|
||||
description="Number of vertices in the graph",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=10,
|
||||
lower_field_name="min_num_vertices",
|
||||
upper_field_name="max_num_vertices",
|
||||
),
|
||||
|
|
@ -266,10 +263,7 @@ class GraphColorCurriculum(BaseCurriculum):
|
|||
name="num_colors",
|
||||
field_name="num_colors",
|
||||
levels=[5, 4, 3],
|
||||
default_level=0,
|
||||
description="Number of colors in the graph",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=3,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import get_data_file_path
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -133,20 +133,14 @@ class GroupAnagramsCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="anagram_groups",
|
||||
levels=[10, 100, 1_000, 10_000],
|
||||
default_level=0,
|
||||
description="Number of anagram groups in the input",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_anagram_groups",
|
||||
upper_field_name="max_anagram_groups",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="words_per_group",
|
||||
levels=[2, 5, 10, 20],
|
||||
default_level=0,
|
||||
description="Number of words in a single anagram group",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_words_per_group",
|
||||
upper_field_name="max_words_per_group",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Two strings are isomorphic if the characters in one string can be replaced to get the second string.
|
||||
|
|
@ -126,10 +126,7 @@ class IsomorphicStringsCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="string_length",
|
||||
levels=[10, 50, 100, 1000],
|
||||
default_level=0,
|
||||
description="Length of the strings",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_string_length",
|
||||
upper_field_name="max_string_length",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from functools import reduce
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, ScalarAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -329,19 +329,13 @@ class JugsCurriculum(BaseCurriculum):
|
|||
name="num_jugs",
|
||||
field_name="num_jugs",
|
||||
levels=[3, 4, 5, 7],
|
||||
default_level=0,
|
||||
description="Number of jugs in the puzzle",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=3,
|
||||
),
|
||||
ScalarAttributeDefinition(
|
||||
name="difficulty",
|
||||
field_name="difficulty",
|
||||
levels=[2, 4, 6, 8],
|
||||
default_level=0,
|
||||
description="Minimum required moves to solve the puzzle",
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=10,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import Optional
|
|||
|
||||
from reasoning_gym.data import read_data_file
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -81,12 +81,10 @@ class LetterCountingCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="words",
|
||||
levels=[10, 50, 100, 1000],
|
||||
default_level=1,
|
||||
description="Number of words in the span",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import Any, Optional
|
|||
|
||||
from reasoning_gym.data import read_data_file
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Your task is to unsramble words in a sentence.
|
||||
|
|
@ -169,32 +169,26 @@ class LetterJumbleCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="word_len",
|
||||
levels=[5, 15, 30, 50],
|
||||
default_level=1,
|
||||
description="Word length",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_word_len",
|
||||
upper_field_name="max_word_len",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="words",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=1,
|
||||
description="Number of words",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=5,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="corruption_level",
|
||||
levels=[0.1, 0.3, 0.6, 0.9],
|
||||
default_level=1,
|
||||
description="Corruption level",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0.0,
|
||||
lower_field_name="min_corruption_level",
|
||||
upper_field_name="max_corruption_level",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import Any, Optional
|
|||
|
||||
import numpy as np
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """For the following matrix:
|
||||
|
|
@ -327,30 +327,21 @@ class ManipulateMatrixCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="rows",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Number of rows in the matrix",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_rows",
|
||||
upper_field_name="max_rows",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="cols",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Number of columns in the matrix",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_cols",
|
||||
upper_field_name="max_cols",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="num_transforms",
|
||||
levels=[5, 10, 20, 30],
|
||||
default_level=0,
|
||||
description="Number of transformations to apply",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_transforms",
|
||||
upper_field_name="max_transforms",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -113,32 +113,26 @@ class NumberFilteringCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="numbers",
|
||||
levels=[10, 100, 500, 1000],
|
||||
default_level=1,
|
||||
description="How many numbers to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_numbers",
|
||||
upper_field_name="max_numbers",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="decimals",
|
||||
levels=[0, 2, 4, 6],
|
||||
default_level=1,
|
||||
description="Number of decimal places",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_decimals",
|
||||
upper_field_name="max_decimals",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="value",
|
||||
levels=[-10_000, 10_000],
|
||||
default_level=1,
|
||||
description="Range of numbers to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=-10_000,
|
||||
lower_field_name="min_value",
|
||||
upper_field_name="max_value",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
||||
|
|
@ -110,32 +110,26 @@ class NumberSortingCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="numbers",
|
||||
levels=[10, 100, 500, 1000],
|
||||
default_level=1,
|
||||
description="How many numbers to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_numbers",
|
||||
upper_field_name="max_numbers",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="decimals",
|
||||
levels=[0, 2, 4, 6],
|
||||
default_level=1,
|
||||
description="Number of decimal places",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_decimals",
|
||||
upper_field_name="max_decimals",
|
||||
ensure_interval=True,
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="value",
|
||||
levels=[-10_000, 10_000],
|
||||
default_level=1,
|
||||
description="Range of numbers to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=-10_000,
|
||||
lower_field_name="min_value",
|
||||
upper_field_name="max_value",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import string
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPALTE = """Your task is, given a list of letters, to form a valid palindrome.
|
||||
|
|
@ -129,12 +129,10 @@ class PalindromeCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="length",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=1,
|
||||
description="Length of the generated palindrome.",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_length",
|
||||
upper_field_name="max_length",
|
||||
ensure_interval=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a string, partition it such that every substring is a palindrome.
|
||||
|
|
@ -156,20 +156,14 @@ class PalindromePartitioningCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="string_len",
|
||||
levels=[10, 100, 500, 1000],
|
||||
default_level=0,
|
||||
description="Length of the string",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_string_len",
|
||||
upper_field_name="max_string_len",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="substring_palindrome_len",
|
||||
levels=[5, 10, 50, 100],
|
||||
default_level=0,
|
||||
description="Length of the substring palindrome",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_substring_palindrome_len",
|
||||
upper_field_name="max_substring_palindrome_len",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from typing import Any, Optional
|
|||
|
||||
import numpy as np
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Your job is to perform max/average pooling on the given matrix.
|
||||
|
|
@ -134,30 +134,21 @@ class PoolMatrixCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="rows",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Board size",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_rows",
|
||||
upper_field_name="max_rows",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="cols",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Board size",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_cols",
|
||||
upper_field_name="max_cols",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="pool_size",
|
||||
levels=[3, 5, 7, 9],
|
||||
default_level=0,
|
||||
description="Pool size",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_pool_size",
|
||||
upper_field_name="max_pool_size",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given two strings representing a ransom note and a magazine, return True if you can construct the ransom note using the letters in the magazine, and False otherwise.
|
||||
|
|
@ -120,20 +120,14 @@ class RansomNoteCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="note_length",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=0,
|
||||
description="Length of the ransom note",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_note_length",
|
||||
upper_field_name="max_note_length",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="magazine_length",
|
||||
levels=[50, 100, 500, 1000],
|
||||
default_level=0,
|
||||
description="Length of the magazine",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_magazine_length",
|
||||
upper_field_name="max_magazine_length",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a square matrix, your job is to rotate it clockwise.
|
||||
|
|
@ -103,20 +103,14 @@ class RotateMatrixCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Size of the square matrix",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="num_rotations",
|
||||
levels=[4, 8, 12, 16],
|
||||
default_level=0,
|
||||
description="Number of 90-degree rotations",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_rotations",
|
||||
upper_field_name="max_rotations",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """You are given an n x n grid where each cell can have one of three values:
|
||||
|
|
@ -136,10 +136,7 @@ class RottenOrangesCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Size of the square matrix",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import read_data_file
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -124,12 +124,10 @@ class SentenceReorderingCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="words_in_sentence",
|
||||
levels=[5, 20, 50, 100],
|
||||
default_level=1,
|
||||
description="Number of words in the sentence",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=3,
|
||||
lower_field_name="min_words_in_sentence",
|
||||
upper_field_name="max_words_in_sentence",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import read_data_file
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -81,12 +81,10 @@ class SpellBackwardCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="word_len",
|
||||
levels=[5, 10, 20, 30],
|
||||
default_level=1,
|
||||
description="Word length",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=3,
|
||||
lower_field_name="min_word_len",
|
||||
upper_field_name="max_word_len",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a matrix, your job is to generate a list of elements in spiral order, starting from the top-left element.
|
||||
|
|
@ -148,10 +148,7 @@ class SpiralMatrixCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="n",
|
||||
levels=[10, 25, 50, 100],
|
||||
default_level=0,
|
||||
description="Number of rows/cols in the matrix",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_n",
|
||||
upper_field_name="max_n",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Given a string consisting of characters A, B, C, D, and E, your job is to insert a character according to the following pattern:
|
||||
|
|
@ -120,12 +120,10 @@ class StringInsertionCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="string_length",
|
||||
levels=[10, 50, 100, 1000],
|
||||
default_level=1,
|
||||
description="Length of the string",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=5,
|
||||
lower_field_name="min_string_length",
|
||||
upper_field_name="max_string_length",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """Your job is to repeatedly transform a string according to a set of rules until no further transformations can be performed, or a state is repeated.
|
||||
|
|
@ -200,20 +200,14 @@ class StringManipulationCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="string_length",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=0,
|
||||
description="Length of the string",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_string_length",
|
||||
upper_field_name="max_string_length",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="num_rules",
|
||||
levels=[5, 10, 15, 20],
|
||||
default_level=0,
|
||||
description="Number of rules to apply",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=1,
|
||||
lower_field_name="min_num_rules",
|
||||
upper_field_name="max_num_rules",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """There is a dismantling engineer who has old machines A, B, and C.
|
||||
|
|
@ -143,12 +143,10 @@ class StringSplittingCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="initial_machines",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=1,
|
||||
description="Number of initial machines",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_initial_machines",
|
||||
upper_field_name="max_initial_machines",
|
||||
ensure_interval=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
QUESTION_TEMPLATE = """There are nine different blocks [A] [B] [C] {{A}} {{B}} {{C}} (A) (B) (C)
|
||||
|
|
@ -148,12 +148,10 @@ class StringSynthesisCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="initial_blocks",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=1,
|
||||
description="Number of initial blocks",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=0,
|
||||
lower_field_name="min_initial_blocks",
|
||||
upper_field_name="max_initial_blocks",
|
||||
ensure_interval=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import get_data_file_path
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -278,12 +278,10 @@ class WordLadderCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="word_length",
|
||||
levels=[3, 4, 5, 6],
|
||||
default_level=1,
|
||||
description="Length of words in the puzzle",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_word_length",
|
||||
upper_field_name="max_word_length",
|
||||
ensure_interval=True,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
|||
from random import Random
|
||||
from typing import Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import read_data_file
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -75,12 +75,10 @@ class WordSequenceReversalCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="words",
|
||||
levels=[10, 50, 100, 500],
|
||||
default_level=1,
|
||||
description="Number of words in the list",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
ensure_interval=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from enum import StrEnum
|
|||
from random import Random
|
||||
from typing import Any, Optional
|
||||
|
||||
from ..coaching import AttributeType, BaseCurriculum, RangeAttributeDefinition
|
||||
from ..coaching import BaseCurriculum, RangeAttributeDefinition
|
||||
from ..data import read_data_file
|
||||
from ..factory import ProceduralDataset, register_dataset
|
||||
|
||||
|
|
@ -137,20 +137,14 @@ class WordSortingCurriculum(BaseCurriculum):
|
|||
RangeAttributeDefinition(
|
||||
name="num_words",
|
||||
levels=[5, 10, 20, 30],
|
||||
default_level=0,
|
||||
description="Number of words to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=5,
|
||||
lower_field_name="min_words",
|
||||
upper_field_name="max_words",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="word_length",
|
||||
levels=[3, 6, 9, 12],
|
||||
default_level=0,
|
||||
description="Length of words to sort",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=3,
|
||||
lower_field_name="min_word_length",
|
||||
upper_field_name="max_word_length",
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue