Skip to content

Commit f388345

Browse files
author
miskibin
committed
feat: Enhance README and add reinforcement learning example
- Updated README to include details on AI engine support and features, emphasizing the HUB protocol for external engine communication. - Added a new section on compatible engines and their capabilities. - Introduced a complete reinforcement learning example in `examples/reinforcement_learning.py`, demonstrating training a policy network using REINFORCE with self-play. - Expanded documentation in `ai.rst` to reference the new RL example and its components.
1 parent 00220d0 commit f388345

File tree

3 files changed

+497
-1
lines changed

3 files changed

+497
-1
lines changed

docs/source/ai.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,24 @@ and its 180° rotation are strategically equivalent (with colors swapped):
311311
tensor = board.to_tensor() # (4, 32)
312312
mask = board.legal_moves_mask() # (1024,)
313313
314+
Complete RL Example
315+
-------------------
316+
317+
See ``examples/reinforcement_learning.py`` for a complete working example
318+
that trains a policy network using REINFORCE with self-play:
319+
320+
.. code-block:: bash
321+
322+
pip install torch
323+
python examples/reinforcement_learning.py
324+
325+
The example includes:
326+
327+
- Policy network (MLP) for move selection
328+
- Self-play game generation
329+
- REINFORCE training loop with discount returns
330+
- Evaluation against random baseline
331+
- Temperature annealing for exploration
314332

315333
API Reference
316334
-------------

0 commit comments

Comments
 (0)