From dd2f00b07e52421a2c0e01e9833370b9db95456e Mon Sep 17 00:00:00 2001 From: EduardDurech <39579228+EduardDurech@users.noreply.github.com> Date: Mon, 27 Jan 2025 09:20:26 +0000 Subject: [PATCH 1/3] README Formatting for TOC and future generators --- README.md | 66 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1aa191cc..a03e54d7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ We are building a python library of procedural dataset generators and algorithmi The goal is to generate virtually infinite data with adjustable complexity. -### Set up for development +## Set up for development 1. Clone the project ``` git clone https://github.com/open-thought/reasoning-gym.git @@ -28,7 +28,7 @@ pip install -r requirements-dev.txt pip install reasoning-gym ``` -### How to instantiate a task dataset? +## How to instantiate a task dataset? Example: @@ -82,14 +82,14 @@ Available dataset names (which can be used with `create_dataset()`): 'syllogism', ``` -### Task Overview +## Task Overview -#### Algebra Tasks +### Algebra Tasks - `SimpleEquationsDataset`: Generate linear equations with one variable to solve (e.g. "3\*x + 2 = 14") - `PolynomialEquationsDataset`: Generate polynomial equations with one variable to solve (e.g. "-6*h\*\*4 + 4*h\**2 - 5*h = 0") -#### Arithmetic Tasks +### Arithmetic Tasks - `BasicArithmeticDataset`: Generate arithmetic expressions with configurable complexity and operators (+, -, \*, /) - `ChainSum`: Generate addition/subtraction chains with configurable length and digit counts @@ -99,7 +99,7 @@ Available dataset names (which can be used with `create_dataset()`): - `LegCountingDataset`: Generate animal leg counting word problems with various animals - `PrimeFactorizationDataset`: Generate prime factorization tasks with configurable number ranges -#### Algorithmic Tasks +### Algorithmic Tasks - `BaseConversionDataset`: Convert numbers between different bases (binary, hex, etc.) - `CaesarCipherDataset`: Encrypt/decrypt text using Caesar cipher with configurable rotation @@ -111,29 +111,32 @@ Available dataset names (which can be used with `create_dataset()`): - `SpellBackwardDataset`: Spell individual words backward (e.g. "sun" -> "nus") - `WordSequenceReversalDataset`: Reverse word order in text spans -#### Cognition Tasks +### Cognition Tasks - `NumberSequenceDataset`: Generate number sequences with discoverable patterns - `ColorCubeRotationDataset`: Generate 3D spatial reasoning tasks with colored cube rotations and orientation tracking -#### Logic Tasks +### Logic Tasks - `PropositionalLogicDataset`: Generate propositional logic reasoning problems -#### Graph Tasks +### Graph Tasks - `FamilyRelationshipsDataset`: Generate family relationship reasoning tasks with family trees -#### Game Tasks +### Game Tasks - `SudokuDataset`: Generate 9x9 Sudoku puzzles with configurable number of empty cells - `MiniSudokuDataset`: Generate 4x4 Mini Sudoku puzzles with configurable difficulty - `MazeDataset`: Generates a maze with a start and a goal - `CountdownDataset`: Generate number game tasks where numbers and operators must be combined to reach a target value -### Available Generators +## Available Generators -### PolynomialEquations +
+ +
PolynomialEquations
+
Generate polynomial equation with configurable complexity: @@ -163,8 +166,12 @@ Example output: {'question': 'Solve the polynomial equation for real i:\n3*i**4 + 4*i**3 - 1 = 0', 'answer': '[]', 'metadata': {'polynomial_expr': '3*i**4 + 4*i**3 - 1', 'variable': 'i', 'degree': 4, 'real_solutions': []}} {'question': 'Solve the polynomial equation for real h:\n7*h**4 - 2*h**2 + h = 0', 'answer': '[-0.6998793469266564, 0.0]', 'metadata': {'polynomial_expr': '7*h**4 - 2*h**2 + h', 'variable': 'h', 'degree': 4, 'real_solutions': [-0.6998793469266564, 0.0]}} ``` +
-#### Basic Arithmetic +
+ +
Basic Arithmetic
+
Generates arithmetic problems with configurable complexity: @@ -195,8 +202,12 @@ Example output: {'question': '-22 - -94 + -97 =', 'answer': '-25', 'metadata': {'num_terms': 3, 'num_digits': 2, 'expression': '-22 - -94 + -97'}} {'question': '51 * 63 =', 'answer': '3213', 'metadata': {'num_terms': 2, 'num_digits': 2, 'expression': '51 * 63'}} ``` +
-#### Chain Sum +
+ +
Chain Sum
+
Generates addition/subtraction problems with configurable complexity: @@ -232,8 +243,12 @@ Example data: "metadata": { "num_terms": 2, "num_digits": 3, "expression": "426 + 562" } } ``` +
-#### Sequence Completion +
+ +
Sequence Completion
+
Generates number sequence completion tasks with dynamic pattern generation: @@ -269,8 +284,12 @@ Example data: "metadata": {"rule": "add 6", "complexity": 1, "sequence": [8, 14, 20, 26, 32, 38, 44, 50]}, } ``` +
-#### Color Cube Rotation +
+ +
Color Cube Rotation
+
Generates 3D spatial reasoning tasks with cube rotations and color tracking: @@ -303,8 +322,12 @@ Example data: } } ``` +
-#### Propositional Logic +
+ +
Propositional Logic
+
Generates logical reasoning tasks with configurable complexity: @@ -344,8 +367,12 @@ Example data: }, } ``` +
-#### Maze +
+ +
Maze
+
Generates a maze with configurable difficulty: @@ -394,8 +421,9 @@ Legend: '<' = Wall, 'w' = Path {'question': "Navigate from 'J' (start) to '_' (goal):\n\n<<<<<\n< -### Future Generator Ideas +## Future Generator Ideas - More complex math tasks (algebra, geometry) - Algorithmic tasks (counting, sorting, re-ordering) From 920e5a400d32c087ea552d9190bbabb4dcdfac82 Mon Sep 17 00:00:00 2001 From: EduardDurech <39579228+EduardDurech@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:02:55 +0100 Subject: [PATCH 2/3] GitHub Compatibility --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a03e54d7..7579548b 100644 --- a/README.md +++ b/README.md @@ -135,10 +135,10 @@ Available dataset names (which can be used with `create_dataset()`):
-
PolynomialEquations
-
+

PolynomialEquations

Generate polynomial equation with configurable complexity: + ```python from reasoning_gym.algebra import PolynomialEquationsConfig, PolynomialEquationsConfig @@ -170,10 +170,10 @@ Example output:
-
Basic Arithmetic
-
+

Basic Arithmetic

Generates arithmetic problems with configurable complexity: + ```python from reasoning_gym.arithmetic import BasicArithmeticDataset, BasicArithmeticDatasetConfig @@ -206,10 +206,10 @@ Example output:
-
Chain Sum
-
+

Chain Sum

Generates addition/subtraction problems with configurable complexity: + ```python from reasoning_gym.arithmetic import ChainSum, ChainSumConfig @@ -247,10 +247,10 @@ Example data:
-
Sequence Completion
-
+

Sequence Completion

Generates number sequence completion tasks with dynamic pattern generation: + ```python from reasoning_gym.cognition import NumberSequenceDataset, NumberSequenceConfig @@ -288,10 +288,10 @@ Example data:
-
Color Cube Rotation
-
+

Color Cube Rotation

Generates 3D spatial reasoning tasks with cube rotations and color tracking: + ```python from reasoning_gym.cognition import ColorCubeRotationDataset, ColorCubeRotationConfig @@ -326,10 +326,10 @@ Example data:
-
Propositional Logic
-
+

Propositional Logic

Generates logical reasoning tasks with configurable complexity: + ```python from reasoning_gym.logic import PropositionalLogicDataset, PropositionalLogicConfig @@ -371,10 +371,10 @@ Example data:
-
Maze
-
+

Maze

Generates a maze with configurable difficulty: + ```python from reasoning_gym.games import MazeConfig, MazeDataset From ac0aa48cb216f415e6fec1e41aba8141c2181d7b Mon Sep 17 00:00:00 2001 From: EduardDurech <39579228+EduardDurech@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:27:59 +0100 Subject: [PATCH 3/3] GitHub-compatible formatting --- README.md | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 7579548b..ac8940b3 100644 --- a/README.md +++ b/README.md @@ -128,16 +128,15 @@ Available dataset names (which can be used with `create_dataset()`): - `SudokuDataset`: Generate 9x9 Sudoku puzzles with configurable number of empty cells - `MiniSudokuDataset`: Generate 4x4 Mini Sudoku puzzles with configurable difficulty -- `MazeDataset`: Generates a maze with a start and a goal +- `MazeDataset`: Generate a maze with a start and a goal - `CountdownDataset`: Generate number game tasks where numbers and operators must be combined to reach a target value ## Available Generators
-

PolynomialEquations

- -Generate polynomial equation with configurable complexity: +

PolynomialEquations

+Generate polynomial equations with configurable complexity:
```python @@ -170,9 +169,8 @@ Example output:
-

Basic Arithmetic

- -Generates arithmetic problems with configurable complexity: +

Basic Arithmetic

+Generate arithmetic problems with configurable complexity:
```python @@ -206,9 +204,8 @@ Example output:
-

Chain Sum

- -Generates addition/subtraction problems with configurable complexity: +

Chain Sum

+Generate addition/subtraction problems with configurable complexity:
```python @@ -247,9 +244,8 @@ Example data:
-

Sequence Completion

- -Generates number sequence completion tasks with dynamic pattern generation: +

Sequence Completion

+Generate number sequence completion tasks with dynamic pattern generation:
```python @@ -288,9 +284,8 @@ Example data:
-

Color Cube Rotation

- -Generates 3D spatial reasoning tasks with cube rotations and color tracking: +

Color Cube Rotation

+Generate 3D spatial reasoning tasks with cube rotations and color tracking:
```python @@ -326,9 +321,8 @@ Example data:
-

Propositional Logic

- -Generates logical reasoning tasks with configurable complexity: +

Propositional Logic

+Generate logical reasoning tasks with configurable complexity:
```python @@ -371,9 +365,8 @@ Example data:
-

Maze

- -Generates a maze with configurable difficulty: +

Maze

+Generate a maze with configurable difficulty:
```python