The codes are implemented under python==3.9, Tensorflow==2.5.0, numpy==1.21.0
python main_v1.py
python main_v2.py
To compete the models in arena, modify the directory of the n1.load_checkpoint() and the competitors, and run
python pit.py
To run the test scripts, first, you need to install pytest:
pip install pytest
- Unit test
This unit test script includes test cases for checking the functions in the game and board classes. You can run the tests by executing the following command:
# for version 1
cd tictactoe_v1/test
pytest test_prob_tictactoe.py
# for version 2
cd tictactoe_v2/test
pytest test_units.py
- Integration tests The integration test suite plays two quick games using an untrained neural network (randomly initialized) against a random player for each combination of game and ML framework. To run integration tests, execute:
# for version 1
cd tictactoe_v1/test
pytest test_integration.py
# for version 2
cd tictactoe_v2/test
pytest test_integration.py
- Regression tests
To run regression test, run
# for version 1
cd tictactoe_v1/test
pytest test_regression.py
The codes are modified from the alpha-zero-general repository.