New Giraffe

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: New Giraffe

Post by matthewlai »

mcostalba wrote:
matthewlai wrote: * The biggest change is porting the neural network code from my own DIY framework to Torch
I would have expected Tensorflow here :-)

https://research.googleblog.com/2016/04 ... rflow.html

BTW, congratulations for this! It is really fascinating, I am glad you have not given up with Giraffe.
Yeah back when I ported it Tensorflow didn't support Windows. Now it does, but I'm too lazy to port it again!

Thanks!
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New Giraffe

Post by Guenther »

matthewlai wrote:
Guenther wrote:
matthewlai wrote: New version: https://bitbucket.org/waterreaction/gir ... 161023.zip
...

Code: Select all

Ex-author of Giraffe, an engine based on deep reinforcement learning. https://bitbucket.org/waterreaction/giraffe/overview
Matthew shouldn't you change your signature now? :)
I should :).
From the commandline (pic also in Ruxys post) I can see that you plan (or already have?) to add GTB (Gaviota TBS) access. Is that true?
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: New Giraffe

Post by matthewlai »

Guenther wrote:
matthewlai wrote:
Guenther wrote:
matthewlai wrote: New version: https://bitbucket.org/waterreaction/gir ... 161023.zip
...

Code: Select all

Ex-author of Giraffe, an engine based on deep reinforcement learning. https://bitbucket.org/waterreaction/giraffe/overview
Matthew shouldn't you change your signature now? :)
I should :).
From the commandline (pic also in Ruxys post) I can see that you plan (or already have?) to add GTB (Gaviota TBS) access. Is that true?
It's already supported. See here for instructions: https://bitbucket.org/waterreaction/giraffe/overview
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New Giraffe

Post by Guenther »

matthewlai wrote:
Guenther wrote:
matthewlai wrote:
Guenther wrote:
matthewlai wrote: New version: https://bitbucket.org/waterreaction/gir ... 161023.zip
...

Code: Select all

Ex-author of Giraffe, an engine based on deep reinforcement learning. https://bitbucket.org/waterreaction/giraffe/overview
Matthew shouldn't you change your signature now? :)
I should :).
From the commandline (pic also in Ruxys post) I can see that you plan (or already have?) to add GTB (Gaviota TBS) access. Is that true?
It's already supported. See here for instructions: https://bitbucket.org/waterreaction/giraffe/overview
I see this was already in previous Giraffe, but all of this happened in my hiatus.

There is a problem now. I added the path to my system as an environment variable,
because I don't know how to add it as a persistent option for Giraffe in
WB when using it as plain xboard program?
(That stuff also was not available before my hiatus and I never needed it so far)

Anyhow Giraffe 20150908 runs fine with it, when the new Giraffe now crashes soon after start, apperently exactly at the time of initialising.
(Did the format of GTB also change again since 2014? They are cp4 and
only up to 4men.)

Code: Select all

Version: WinBoard 4.8.0b + Giraffe_20150908-64
Reset(1, 0) from gameMode 0
...
854 >first : new
random
854 >first : level 40 20 0
854 >first : post
854 >first : hard
854 >first : easy
854 >first : ping 1
Impossible move , type = 0
2241 <first &#58; # 
2241 <first &#58; # GTB PATHS
2241 <first &#58; #   main&#58; C&#58;\GTB
2241 <first &#58; # 
2241 <first &#58; # GTB initialization
2242 <first &#58; #   Compression  Scheme = 4
2242 <first &#58; #   Compression Indexes &#40;3-pc&#41; = PASSED
2242 <first &#58; #   Compression Indexes &#40;4-pc&#41; = PASSED
2242 <first &#58; #   Compression Indexes &#40;5-pc&#41; = **FAILED**
2242 <first &#58; # 
2242 <first &#58; pong 1
nps&#58; w=-1, b=-1
nps&#58; w=-1, b=-1
2994 >first &#58; time 120000
2995 >first &#58; otim 120000
book hit = &#40;NULL&#41;
2995 >first &#58; usermove 2995 >first &#58; b2b3
3047 <first &#58; # Allocated 60, 120 seconds
3047 <first &#58; 1 82 0 27 d7d5 

Code: Select all

...
Version&#58; WinBoard 4.8.0b + Giraffe_20161023-64
Reset&#40;1, 0&#41; from gameMode 0
recognized 'normal' (-1&#41; as variant normal
GameEnds&#40;0, &#40;null&#41;, 2&#41;
shuffleOpenings = 0
StartChildProcess &#40;dir="C&#58;\Engines\WB\Giraffe_20161023-64") Giraffe_20161023-64
nice engine proc to 10
702 >first &#58; xboard
protover 2
730 <first &#58; # Using 4 OpenMP thread&#40;s&#41;
730 <first &#58; # Version&#58; 6e670d993d24
730 <first &#58; # Running in release mode
730 <first &#58; # Using ANN evaluator
731 <first &#58; # Using static move evaluator
731 <first &#58; feature ping=1 setboard=1 playother=0 san=0 usermove=1 time=1 draw=0 sigint=0 sigterm=0 reuse=1 analyze=1 myname="Giraffe 6e670d993d24" variants=normal colors=0 ics=0 name=0 pause=0 nps=0 debug=1 memory=0 smp=0 done=0
732 >first &#58; accepted ping
732 >first &#58; accepted setboard
732 >first &#58; accepted playother
732 >first &#58; accepted san
732 >first &#58; accepted usermove
732 >first &#58; accepted time
732 >first &#58; accepted draw
732 >first &#58; accepted sigint
733 >first &#58; accepted sigterm
733 >first &#58; accepted reuse
733 >first &#58; accepted analyze
733 >first &#58; accepted myname
733 >first &#58; rejected variants
733 >first &#58; accepted colors
733 >first &#58; accepted ics
734 >first &#58; accepted name
734 >first &#58; accepted pause
734 >first &#58; accepted nps
734 >first &#58; accepted debug
734 >first &#58; accepted memory
734 >first &#58; accepted smp
734 >first &#58; accepted done
734 <first &#58; feature option="GaviotaTbPath -path ."
735 >first &#58; accepted option
735 <first &#58; feature done=1
735 >first &#58; accepted done
746 >first &#58; new
random
746 >first &#58; level 40 20 0
746 >first &#58; post
746 >first &#58; hard
746 >first &#58; easy
746 >first &#58; ping 1
Impossible move , type = 0
Fatal Error&#58; Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly
GameEnds&#40;27, Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly, 2&#41;
14920 >first &#58; result 0-1 &#123;Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly&#125;
14921 >first &#58; force
14921 >first &#58; ping 2
15021 >first &#58; quit
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: New Giraffe

Post by matthewlai »

Guenther wrote:
matthewlai wrote:
Guenther wrote:
matthewlai wrote:
Guenther wrote:
matthewlai wrote: New version: https://bitbucket.org/waterreaction/gir ... 161023.zip
...

Code: Select all

Ex-author of Giraffe, an engine based on deep reinforcement learning. https&#58;//bitbucket.org/waterreaction/giraffe/overview
Matthew shouldn't you change your signature now? :)
I should :).
From the commandline (pic also in Ruxys post) I can see that you plan (or already have?) to add GTB (Gaviota TBS) access. Is that true?
It's already supported. See here for instructions: https://bitbucket.org/waterreaction/giraffe/overview
I see this was already in previous Giraffe, but all of this happened in my hiatus.

There is a problem now. I added the path to my system as an environment variable,
because I don't know how to add it as a persistent option for Giraffe in
WB when using it as plain xboard program?
(That stuff also was not available before my hiatus and I never needed it so far)

Anyhow Giraffe 20150908 runs fine with it, when the new Giraffe now crashes soon after start, apperently exactly at the time of initialising.
(Did the format of GTB also change again since 2014? They are cp4 and
only up to 4men.)

Code: Select all

Version&#58; WinBoard 4.8.0b + Giraffe_20150908-64
Reset&#40;1, 0&#41; from gameMode 0
...
854 >first &#58; new
random
854 >first &#58; level 40 20 0
854 >first &#58; post
854 >first &#58; hard
854 >first &#58; easy
854 >first &#58; ping 1
Impossible move , type = 0
2241 <first &#58; # 
2241 <first &#58; # GTB PATHS
2241 <first &#58; #   main&#58; C&#58;\GTB
2241 <first &#58; # 
2241 <first &#58; # GTB initialization
2242 <first &#58; #   Compression  Scheme = 4
2242 <first &#58; #   Compression Indexes &#40;3-pc&#41; = PASSED
2242 <first &#58; #   Compression Indexes &#40;4-pc&#41; = PASSED
2242 <first &#58; #   Compression Indexes &#40;5-pc&#41; = **FAILED**
2242 <first &#58; # 
2242 <first &#58; pong 1
nps&#58; w=-1, b=-1
nps&#58; w=-1, b=-1
2994 >first &#58; time 120000
2995 >first &#58; otim 120000
book hit = &#40;NULL&#41;
2995 >first &#58; usermove 2995 >first &#58; b2b3
3047 <first &#58; # Allocated 60, 120 seconds
3047 <first &#58; 1 82 0 27 d7d5 

Code: Select all

...
Version&#58; WinBoard 4.8.0b + Giraffe_20161023-64
Reset&#40;1, 0&#41; from gameMode 0
recognized 'normal' (-1&#41; as variant normal
GameEnds&#40;0, &#40;null&#41;, 2&#41;
shuffleOpenings = 0
StartChildProcess &#40;dir="C&#58;\Engines\WB\Giraffe_20161023-64") Giraffe_20161023-64
nice engine proc to 10
702 >first &#58; xboard
protover 2
730 <first &#58; # Using 4 OpenMP thread&#40;s&#41;
730 <first &#58; # Version&#58; 6e670d993d24
730 <first &#58; # Running in release mode
730 <first &#58; # Using ANN evaluator
731 <first &#58; # Using static move evaluator
731 <first &#58; feature ping=1 setboard=1 playother=0 san=0 usermove=1 time=1 draw=0 sigint=0 sigterm=0 reuse=1 analyze=1 myname="Giraffe 6e670d993d24" variants=normal colors=0 ics=0 name=0 pause=0 nps=0 debug=1 memory=0 smp=0 done=0
732 >first &#58; accepted ping
732 >first &#58; accepted setboard
732 >first &#58; accepted playother
732 >first &#58; accepted san
732 >first &#58; accepted usermove
732 >first &#58; accepted time
732 >first &#58; accepted draw
732 >first &#58; accepted sigint
733 >first &#58; accepted sigterm
733 >first &#58; accepted reuse
733 >first &#58; accepted analyze
733 >first &#58; accepted myname
733 >first &#58; rejected variants
733 >first &#58; accepted colors
733 >first &#58; accepted ics
734 >first &#58; accepted name
734 >first &#58; accepted pause
734 >first &#58; accepted nps
734 >first &#58; accepted debug
734 >first &#58; accepted memory
734 >first &#58; accepted smp
734 >first &#58; accepted done
734 <first &#58; feature option="GaviotaTbPath -path ."
735 >first &#58; accepted option
735 <first &#58; feature done=1
735 >first &#58; accepted done
746 >first &#58; new
random
746 >first &#58; level 40 20 0
746 >first &#58; post
746 >first &#58; hard
746 >first &#58; easy
746 >first &#58; ping 1
Impossible move , type = 0
Fatal Error&#58; Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly
GameEnds&#40;27, Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly, 2&#41;
14920 >first &#58; result 0-1 &#123;Error&#58; first chess program &#40;Giraffe_20161023-64&#41; exited unexpectedly&#125;
14921 >first &#58; force
14921 >first &#58; ping 2
15021 >first &#58; quit
There is now 5-men, but the format is still cp4. I have never actually tested with less than 5-men, but I don't see why it wouldn't work, unless there's a bug in the probing code.

Can you try double clicking and typing in the commands manually and see if it still crashes?

Code: Select all

xboard
post
analyze
PS. Torrent for the 5-men is here: http://oics.olympuschess.com/tracker/
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
Guenther
Posts: 4606
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New Giraffe

Post by Guenther »

matthewlai wrote: There is now 5-men, but the format is still cp4. I have never actually tested with less than 5-men, but I don't see why it wouldn't work, unless there's a bug in the probing code.

Can you try double clicking and typing in the commands manually and see if it still crashes?

Code: Select all

xboard
post
analyze
PS. Torrent for the 5-men is here: http://oics.olympuschess.com/tracker/
I tried commandline already, but since I set the environment variable it crashes, which means I cannot feed commands.
Well, as you can see the older Giraffe works that way.

(I know the download for 5men, but I don't want to download it)

Giraffe_20150908-64:

Code: Select all

# Using 4 OpenMP thread&#40;s&#41;
# Version&#58; 4f4850035475
# Running in release mode
# Using ANN evaluator
# Using ANN move evaluator
#
# GTB PATHS
#   main&#58; C&#58;\GTB
#
# GTB initialization
#   Compression  Scheme = 4
#   Compression Indexes &#40;3-pc&#41; = PASSED
#   Compression Indexes &#40;4-pc&#41; = PASSED
#   Compression Indexes &#40;5-pc&#41; = **FAILED**
#
xboard
post
analyze
1 12 0 21 e2e4
# d&#58; 1 node budget&#58; 1 NPS&#58; 21001.5
2 12 0 42 e2e4
# d&#58; 2 node budget&#58; 4 NPS&#58; 10500.1
3 11 0 85 d2d4
# d&#58; 3 node budget&#58; 16 NPS&#58; 10625.1
4 8 1 238 e2e4 e7e6
# d&#58; 4 node budget&#58; 64 NPS&#58; 18307.7
5 10 2 438 e2e4 e7e5 g1f3
# d&#58; 5 node budget&#58; 256 NPS&#58; 20857.2
6 10 3 814 e2e4 e7e5 g1f3
# d&#58; 6 node budget&#58; 1024 NPS&#58; 24666.7
7 6 4 1569 e2e4 e7e6 g1f3
# d&#58; 7 node budget&#58; 4096 NPS&#58; 31380
8 8 7 3066 e2e4 c7c5 c2c4 d7d6
# d&#58; 8 node budget&#58; 16384 NPS&#58; 38325
9 14 14 6468 e2e4 c7c5 c2c4 d7d6 b1c3 g8f6
# d&#58; 9 node budget&#58; 65536 NPS&#58; 45230.8
10 11 23 12391 e2e4 c7c5 c2c4 d7d6 b1c3 b8c6 g1f3
# d&#58; 10 node budget&#58; 262144 NPS&#58; 53873.9
11 12 49 30166 c2c4 d7d6 b1c3 g8f6 g1f3 c7c5 e2e4
# d&#58; 11 node budget&#58; 1048576 NPS&#58; 61437.9
12 16 96 68689 e2e4 c7c5 c2c4 b8c6 g1f3 d7d6 b1c3 g8f6
# d&#58; 12 node budget&#58; 4194304 NPS&#58; 71402.3
13 18 171 118073 e2e4 c7c5 c2c4 b8c6 d2d3 d7d6 b1c3 a7a5 g1f3
# d&#58; 13 node budget&#58; 16777216 NPS&#58; 69048.5
14 18 394 269030 e2e4 c7c5 c2c4 a7a5 g1f3 d7d6 b1c3 b8c6 d2d3
# d&#58; 14 node budget&#58; 67108864 NPS&#58; 68212.5
15 12 763 529263 e2e4 c7c5 c2c4 d7d6 g1f3 b8c6 b1c3 g8f6 d2d3
# d&#58; 15 node budget&#58; 268435456 NPS&#58; 69302.5
16 9 1607 1085570 e2e4 c7c5 c2c4 d7d6 b1c3 g8f6 g1f3 b8c6 f1e2 c8g4 d2d3 e7e5
# d&#58; 16 node budget&#58; 1073741824 NPS&#58; 67548.4
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: New Giraffe

Post by matthewlai »

Guenther wrote:I tried commandline already, but since I set the environment variable it crashes, which means I cannot feed commands.
Hmm I will give it a try tonight or tomorrow. I have never used a GTB on Windows. Maybe this is Windows-specific.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
carldaman
Posts: 2283
Joined: Sat Jun 02, 2012 2:13 am

Re: New Giraffe + test game

Post by carldaman »

Lyudmil Tsvetkov wrote:
carldaman wrote:Thanks, Matthew. It is a relief to see that Giraffe, the self-taught engine, is not an abandoned project, as many of us had feared. :)

I found Giraffe's playing style original and different from that of a typical engine, and with touch of human-like play at times. Sparring against the previous version from last year was usually a very difficult proposition for me.

Whenever a new version of an interesting engine is released, I like to roll it out by playing one or two test games against it, to get a feel for its strengths and weaknesses. However, I am very surprised and puzzled at the ease with which I, not being a real anti-engine specialist, was able to get a winning position against the new version in the one game I tried against it. Giraffe's play looked very much like computer-chess from the old days, with aimless, passive piece shuffling and lacking in king safety awareness.

Here's the game below. Maybe some insights can be gleaned from it.

[pgn]
[Event "Arena rated test game 5m20s"]
[Date "2016.10.24"]
[White "Carl"]
[Black "Giraffe_161023_x64"]
[Result "*"]
[ECO "A06"]
[WhiteElo "2100"]
[BlackElo "2550?"]
[PlyCount "51"]
[TimeControl "300+20"]

1. Nf3 d5 {[%eval -74,21] [%emt 0:00:50]} 2. e3 c5 {[%eval -66,21] [%emt 0:00:
19]} 3. b3 Nf6 {[%eval -7,21] [%emt 0:00:23]} 4. Bb5+ Nc6 {[%eval -1,21] [%emt
0:00:18]} 5. Ne5 Qc7 {[%eval 36,20] [%emt 0:00:18]} 6. Bb2 Bf5 {[%eval 34,19]
[%emt 0:00:17]} 7. O-O e6 {[%eval 51,20] [%emt 0:00:18]} 8. f4 Be7 {[%eval 60,
18] [%emt 0:00:22]} 9. d3 O-O {[%eval 70,19] [%emt 0:00:21]} 10. Bxc6 bxc6 {
[%eval 45,21] [%emt 0:00:21]} 11. Nd2 Bg6 {[%eval 30,18] [%emt 0:00:22]} 12.
Ndf3 Bf5 {[%eval -16,19] [%emt 0:00:26]} 13. Qe1 h6 {[%eval -25,18] [%emt 0:00:
15]} 14. h3 Rab8 {[%eval -91,20] [%emt 0:00:22]} 15. g4 Bh7 {[%eval -185,21]
[%emt 0:00:18]} 16. g5 hxg5 {[%eval -189,21] [%emt 0:00:21]} 17. Nxg5 c4 {
[%eval -115,20] [%emt 0:00:19]} 18. Rd1 cxd3 {[%eval -113,19] [%emt 0:00:25]}
19. cxd3 a6 {[%eval -118,18] [%emt 0:00:27]} 20. Kh1 Rb5 {[%eval -122,18]
[%emt 0:00:20]} 21. Rg1 Bf5 {[%eval -189,18] [%emt 0:00:29]} 22. e4 Bh7 {
[%eval -265,18] [%emt 0:00:29]} 23. Nxh7 Nxh7 {[%eval -417,19] [%emt 0:00:15]
White forfeits on time just as he was about to play...} 24. Rxg7+ $3 Kxg7 (
24... Kh8 25. Qg3 $18) 25. Qg3+ $140 Kh8 (25... Kf6 26. Nd7#) (25... Kh6 26.
Rg1 (26. Ng4+)) (25... Ng5 26. Nf3+) 26. Nxf7# *
[/pgn]

Giraffe's play clearly feels "out of character" when compared to the previous version. I guess we'll learn and know more when we see more tests.

Cheers,
CL
Man, you need a bulldozer, not a Giraffe to play against. :)
We could sure use an engine called Bulldozer! :)

Lo chiamavano Bulldozer:

http://www.imdb.com/title/tt0077864/

https://www.youtube.com/watch?v=NIuH9_UJ_DE

:lol:
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: New Giraffe

Post by JoshPettus »

MikeB wrote: Joshua - try again - the link is the same.
Seems the same problem. Are you sure you replaced the linked file?
Werewolf
Posts: 1796
Joined: Thu Sep 18, 2008 10:24 pm

Re: New Giraffe

Post by Werewolf »

Matthew,

A while back you specualted about using NN in the search as well as having a NN evaluation function.

Is this still a realistic goal and would it help you if you had access to more cores?

Carl