mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
include ranges rather than sampled values in difficulty metadata dicts (#387)
* update difficulty metadata for logic datasets * update difficulty metadata for graph datasets * update difficulty metadata for geometry datasets * update difficulty metadata for games datasets * update difficulty metadata for cognition datasets * update difficulty metadata for arithmetic datasets * update difficulty metadata for arc datasets * update difficulty metadata for algorithmic datasets * update difficulty metadata for algebra datasets * use tuples * update tests * update tests
This commit is contained in:
parent
b69c35818a
commit
7475a20700
80 changed files with 304 additions and 126 deletions
|
|
@ -126,11 +126,14 @@ class BoxnetDataset(ProceduralDataset):
|
|||
"question": question,
|
||||
"answer": None,
|
||||
"metadata": {
|
||||
"difficulty": {
|
||||
"row_num": row_num,
|
||||
"column_num": column_num,
|
||||
},
|
||||
"row_num": row_num,
|
||||
"column_num": column_num,
|
||||
"initial_state": pg_dict,
|
||||
"difficulty": {
|
||||
"row_num": (self.config.min_row_num, self.config.max_row_num),
|
||||
"column_num": (self.config.min_column_num, self.config.max_column_num),
|
||||
"box_num": (self.config.min_box_num, self.config.max_box_num),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,10 @@ class EmojiMysteryDataset(ProceduralDataset):
|
|||
"answer": secret_sentence,
|
||||
"metadata": {
|
||||
"emoji": secret_emoji,
|
||||
"difficulty": {"num_words_in_sentence": len(re.findall(r"\b\w+\b", secret_sentence))},
|
||||
"num_words_in_sentence": len(re.findall(r"\b\w+\b", secret_sentence)),
|
||||
"difficulty": {
|
||||
"num_words_in_sentence": (self.config.min_words_in_sentence, self.config.max_words_in_sentence),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,12 @@ class FutoshikiDataset(ProceduralDataset):
|
|||
"puzzle": puzzle,
|
||||
"constraints": constraints,
|
||||
"solution": solution,
|
||||
"difficulty": {"board_size": board_size, "difficulty": difficulty},
|
||||
"board_size": board_size,
|
||||
"difficulty_rating": difficulty,
|
||||
"difficulty": {
|
||||
"board_size": (self.config.min_board_size, self.config.max_board_size),
|
||||
"difficulty": (self.config.min_difficulty, self.config.max_difficulty),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,9 @@ class MahjongPuzzleDataset(ProceduralDataset):
|
|||
"metadata": {
|
||||
"rounds": rounds,
|
||||
"solution": answer,
|
||||
"difficulty": {"num_rounds": num_rounds},
|
||||
"difficulty": {
|
||||
"num_rounds": (self.config.min_num_rounds, self.config.max_num_rounds),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ class MazeDataset(ProceduralDataset):
|
|||
"wall": self.wall_char,
|
||||
"path": self.path_char,
|
||||
"difficulty": {
|
||||
"dist": dist,
|
||||
"grid_size": size,
|
||||
"dist": (self.config.min_dist, self.config.max_dist),
|
||||
"grid_size": (self.config.min_grid_size, self.config.max_grid_size),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class MiniSudokuDataset(ProceduralDataset):
|
|||
"solution": solved_board,
|
||||
"num_empty": num_empty,
|
||||
"difficulty": {
|
||||
"empty": num_empty,
|
||||
"empty": (self.config.min_empty, self.config.max_empty),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class NQueensDataset(ProceduralDataset):
|
|||
"valid_answers": valid_solutions_str,
|
||||
"difficulty": {
|
||||
"n": self.config.n,
|
||||
"num_removed": num_removed,
|
||||
"num_removed": (self.config.min_remove, self.config.max_remove),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,9 @@ class RushHourDataset(ProceduralDataset):
|
|||
"metadata": {
|
||||
"board_config": board_config,
|
||||
"min_moves": min_moves,
|
||||
"difficulty": {"min_moves": min_moves},
|
||||
"difficulty": {
|
||||
"min_moves": (self.config.min_moves, self.config.max_moves),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class SokobanDataset(ProceduralDataset):
|
|||
|
||||
# Make the Sokoban!
|
||||
rng = Random(self.seed + idx)
|
||||
gamestr, solution, difficulty = self._generate(
|
||||
gamestr, solution, puzzle_data = self._generate(
|
||||
rng=rng,
|
||||
min_w=self.config.min_w,
|
||||
min_h=self.config.min_h,
|
||||
|
|
@ -93,7 +93,15 @@ Here is your puzzle:
|
|||
"""
|
||||
+ gamestr,
|
||||
"answer": solution,
|
||||
"metadata": {"gamestr": gamestr, "difficulty": difficulty},
|
||||
"metadata": {
|
||||
"gamestr": gamestr,
|
||||
"width": puzzle_data["width"],
|
||||
"height": puzzle_data["height"],
|
||||
"difficulty": {
|
||||
"width": (self.config.min_w, self.config.max_w),
|
||||
"height": (self.config.min_h, self.config.max_h),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def score_answer(self, answer: Optional[str], entry: dict[str, Any]) -> float:
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ class SudokuDataset(ProceduralDataset):
|
|||
"solution": solved_board,
|
||||
"num_empty": num_empty,
|
||||
"difficulty": {
|
||||
"num_empty": num_empty,
|
||||
"empty": (self.config.min_empty, self.config.max_empty),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,6 +275,9 @@ class HanoiDataset(ProceduralDataset):
|
|||
"target_peg": target_peg,
|
||||
"auxiliary_pegs": auxiliary_pegs,
|
||||
"solution_length": len(solution),
|
||||
"difficulty": {
|
||||
"num_disks": (self.min_disks, self.max_disks),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,13 @@ class TsumegoDataset(ProceduralDataset):
|
|||
"Specify your move in coordinates (e.g. 'C4' for column C, row 4)"
|
||||
),
|
||||
"answer": solution_str,
|
||||
"metadata": {"difficulty": {"board_size": size}, "board": board},
|
||||
"metadata": {
|
||||
"board": board,
|
||||
"board_size": size,
|
||||
"difficulty": {
|
||||
"board_size": (self.config.min_board_size, self.config.max_board_size),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def score_answer(self, answer: Optional[str], entry: dict[str, Any]) -> float:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue