Coder Social home page Coder Social logo

htnminh / hex-rl Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 118.15 MB

Implementation of an End-to-End Reinforcement Learning Framework for Hex Strategy Optimization with Command-Line and Graphical User Interfaces

License: GNU General Public License v3.0

Python 100.00%

hex-rl's Introduction

Implementation of an End-to-End Reinforcement Learning Framework for Hex Strategy Optimization with Command-Line and Graphical User Interfaces

Bachelor Thesis at Hanoi University of Science and Technology by Hoang Tran Nhat Minh (20204883)

GitHub repository: https://github.com/htnminh/hex-rl

How to run

Install all dependencies:

pip install -r requirements.txt

Generate models (optional):

DQN models are provided in the model directory. However, if they are not available, they should be generated for the first time, or the only available "AI" is the random agent.

mkdir model
python hex_rl/model_dqn.py

Play a Hex game:

python hex_rl/tk_mainmenu.py

(CLI) Play a Hex game in PvP mode with board size 7x7:

python hex_rl/hex_cli.py play pvp --size 7

(CLI) Show help message:

python hex_rl/hex_cli.py --help

Notes

The project is implemented and tested on Python 3.11.7, and should work on newer releases.

All commands are tested on Windows. python should be replaced with python3 on most Linux distributions.

License

This project is licensed under the GNU General Public License v3.0.

Developer notes

Install pylint and graphviz then run to visualize (sometimes pylint doesn't work well with anaconda, reinstalling pylint via pip is the current best resolution):

pyreverse hex_rl -s 1 -A -m y --colorized
dot -Tsvg classes.dot -o classes.svg
dot -Tsvg packages.dot -o packages.svg

requirements.txt is generated by pipreqs.

Code of Conduct

hex-rl's People

Contributors

htnminh avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.