Skip to content

Isameru/pong-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pong: The Machine Learning Game

The game of pong made to train a bot.

The current attempt fails to learn using (Double) Deep Q-Learning Network.

If you know why it does not work - I would be very grateful for letting me know!

Building on Linux

Requirements

C++17 Compiler of Your choice

sudo apt install g++

CMake 3.16.4

You may use Kitware APT Repository.

LibTorch 1.4

Unzip the PyTorch package. Select Stable (1.4) version, LibTorch package for C++/Java

In external directory, make symbolic link to LibTorch:

cd pong-ml/external
ln -s <path to LibTorch> libtorch-linux
ln -s <path to LibTorch with CUDA support> libtorch-cuda-linux

Simple DirectMedia Layer (v2) with Image and True Type Font Extensions

sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libglew-dev

OpenGL Extension Wrangler Library

sudo apt install libglew-dev

Compilation

git clone https://github.com/Isameru/pong-ml.git
cd pong-ml
mkdir _out
cd _out
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j`nproc`
pong-ml/pong-ml   # To start the game

CUDA Support

If you have the machine capable with strong graphics card and would like to take advantage of GPGPU, install NVIDIA CUDA Toolkit 10.2 and NVIDIA cuDNN v7.6.5. CMake should detect the precesence of this toolkit and build the game using CUDA-enabled version of LibTorch. If you experience issues, hack the CMakeLists.txt to satisfy cmake, compilation, linking, and run-time errors.

About

Pong: The Machine Learning Game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published