erikbern / deep-pink Goto Github PK
View Code? Open in Web Editor NEWDeep Pink is a chess AI that learns to play chess using deep learning.
Home Page: http://erikbern.com/2014/11/29/deep-learning-for-chess/
Deep Pink is a chess AI that learns to play chess using deep learning.
Home Page: http://erikbern.com/2014/11/29/deep-learning-for-chess/
I'm having issues with installing all the dependencies, particularly hdf5. Can you describe more specifically the names of the packages you used and their versions, or post an install script which installs all the correct versions of these packages to create an environment which supports this code?
I actually wanted to write one, but I got stuck... After
PYTHONPATH=$HOME/.local/lib/python2.7/site-packages/ easy_install --user numpy Theano python-chess cython h5py
It seems that itertools
, heapq
and pickle
are available in core Python but I am still stuck how to get ahold of sunfish
easily... as you can tell, my native language is not exactly Python...
Why does the computer always start with the same pawn?
Hi, I got an error when running train.py
I have already download pgn files in the working directory.
When creating function get_data:
test_size = 10000.0 / len(data[0])
print('Splitting', len(data[0]), 'entries into train/test set')
data = train_test_split(*data, test_size=test_size)
len(data[0]) is 0. So comes to the error.
Do you know how to fix that?
I'm sure I have already downloaded pgn files and run parse_game.py at first
Hello,
is Deep Pink a GUI that works only with pychess and sunfish, or can external XB/WB-chess engines e.g. Crafty, GNUChess respectively UCI-chess programs e.g. Stockfish, Toga be embedded into this application too?
concerning Deep Pink Chess Engine:
What´s about implementation of two very common chess protocols UCI respectively WinBoard/XBoard a.k.a. CECP?
http://www.shredderchess.com/download.html - http://download.shredderchess.com/div/uci.zip
http://home.hccnet.nl/h.g.muller/engine-intf.html - http://home.hccnet.nl/h.g.muller/engine-intf.html
Hi. I have some problem while using your tool. There was TypeError: 'instancemethod' object is not iterable. I think that is because you use iterating in function b.pieces. How can I fix this problem and why it appears? Is it only my problem?
Hi,
For h5py installation, please change from pip install hdf5 to pip install h5py.
http://docs.h5py.org/en/latest/build.html
Thanks
I'm getting AssertionErrors when trying to run play.py, with the output looking like this:
maxd 1.000000 maxn 278.426311
Traceback (most recent call last):
File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 226, in game
gn_current = player.move(gn_current)
File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 119, in move
assert(gn_current.board().turn == 0)
AssertionError
and keeps repeating itself. Any idea on how to fix this?
in python-chess 0.9, the function pieces has been changed.
I'm in windows and it seems it's because of os.listdir() has different functionality in unix?
Hi, @erikbern. First of all, congratulations for the hard work.
I've forked your repo and updated it to use Python3 (3.6.7
).
I've also created a Dockerfile
to setup an image that has all dependencies installed.
If you see value on this, please create a branch called py3
and then I'll open a PR on it.
Here is the code.
I've only started playing with the code (ran play.py but now more focused on the blog post), but here are my installation steps. I hope this helps someone.
This all assumes you have Anaconda installed on your machine and use Linux.
If you normally use Python 3, create a new environment for Python 2.7:
conda create -n python2 python=2.7
Environments are like alternate Python installations you can step into whenever you need to. Whenever you want to use the 2.7 environment, use
source activate python2
When installing packages and running deep-pink, make sure you're in a python 2.7 environment. Some of the dependencies can be installed with Anaconda:
conda install theano scikit-learn h5py
python-chess
you can get through pip (will work through Anaconda):
pip install python-chess
Getting Sunfish is a little weirder, since I couldn't get conda or pip to get it. Instead, I cloned the repo git clone https://github.com/thomasahle/sunfish
and just copied sunfish.py from it into deep-pink's directory. According the Sunfish's readme.md, it's self-contained in that one script.
Hello! I have been reading your article on this and implementing it myself to learn pytorch. However, I am a bit confused by your loss function. specifically, why do you include the term:
-log(sigmoid(f(q)-f(r))
and not -log(sigmoid(f(r)-f(q))
? Don't we want to reward f(r)>f(q) with low loss, and punish f(r)<f(q) with high loss, and not the other way around? Just looking for an explanation so I understand :)
I have installed numpy in my ubuntu and window machine.
When it is loading the pickle file in play.py, it is throwing an import error:
I have tried importing numpy.core.multiarray and its working fine , but pickle object is not able to be loaded ?
ImportError: No module named multiarray.
Help is urgently required!
Thanks!
It will be nice to have a pylearn2 support for the training since it will allow to easily explore different approaches for deep learning in chess using this data.
When I run play.py, i get the following error:
Traceback (most recent call last):
File "play.py", line 226, in game
gn_current = player.move(gn_current)
File "play.py", line 196, in move
move, score = sunfish.search(self._pos, maxn=self._maxn)
AttributeError: 'module' object has no attribute 'search'
What does this error mean?
The link to the blog describing deep-pink is dead. Please review it.
Hi again. I've solved problem with the bb2array and start the tool. The model was learned on only 827 games. So it plays very slowly. How I should fix it? Was this problem appeared before?
Downloading Some Dependencies resulted in Pygame not working anymore. Tried reinstalling everything and it didn't solve anything. Using a Mac Yosemite 10.10 Python 2.7 Enthought Canopy heres the error:
ImportError: dlopen(/Users/Patrick/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pygame/base.so, 2): Symbol not found: _SDL_EnableUNICODE
Referenced from: /Users/Patrick/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pygame/base.so
Expected in: flat namespace
in /Users/Patrick/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/pygame/base.so
I think the paths were changed somehow but i dont know how to fix them. Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.