tomitankChess 5.0 with NN

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

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
tomitank
Posts: 258
Joined: Sat Mar 04, 2017 11:24 am
Location: Hungary

tomitankChess 5.0 with NN

Post by tomitank » Mon Jan 18, 2021 7:36 pm

Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

- I have around 10 elo better net (768x32x1) in fix depth test, but JavaScript is too slow, and don’t have AVX or similar methode in JavaScript (so i use vanilla approach). Essentially the smaller net has nearly the same strength in both short and long TC tests.

The training method is similar to that described by Andrew, thanks to him for the explanation.
But the implementation is unique and I have not received any help.
http://talkchess.com/forum3/viewtopic.p ... 72#p874960

This net is not perfect, and HCE slows that down further, but i win around 60-70 or even more. (i don't tested deeply.) In C it would be around 140-150.

I can try to use more examples later, but it’s pretty boring for me.

I also plan to turn off HCE and use only NN, but (probably) the authors of Halogen do this better.

I tried to go my own way, so feel free to send this version to the CCRL list.

Estimated elo: near to 2900.

Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás

User avatar
maksimKorzh
Posts: 636
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: tomitankChess 5.0 with NN

Post by maksimKorzh » Mon Jan 18, 2021 8:03 pm

tomitank wrote:
Mon Jan 18, 2021 7:36 pm
Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

- I have around 10 elo better net (768x32x1) in fix depth test, but JavaScript is too slow, and don’t have AVX or similar methode in JavaScript (so i use vanilla approach). Essentially the smaller net has nearly the same strength in both short and long TC tests.

The training method is similar to that described by Andrew, thanks to him for the explanation.
But the implementation is unique and I have not received any help.
http://talkchess.com/forum3/viewtopic.p ... 72#p874960

This net is not perfect, and HCE slows that down further, but i win around 60-70 or even more. (i don't tested deeply.) In C it would be around 140-150.

I can try to use more examples later, but it’s pretty boring for me.

I also plan to turn off HCE and use only NN, but (probably) the authors of Halogen do this better.

I tried to go my own way, so feel free to send this version to the CCRL list.

Estimated elo: near to 2900.

Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás
Just played in the browser - very strange thing has happened - in Ruy Lopez exchange on c6 variation I had a position when knight on f6 was attacking pawn on e4. I've defended with d2d3 and than knight captured on e4. I played a few moves and got winning endgame. I'm very weal player, around 1700 Elo lichess. Was that a bug?

Default English has gone from the browser mode - I can't read or change language.
Also before engine was hitting up to depth 15 and now it moves instantly for some reason, well probably I just missed the settings because of the non English interface.

Tamas, any chances to get a public tutorial in a format of a "paper" on how did you design/train your net?
I've been following your thread but the discussions there are too complicated.
So any chances to get decent absolute beginners materials on neural nets?

P.S. I'm especially intrigued by the tiny datasets you've been using, also your minimalist approach is very attractive.

EDIT: Just walked through the code.
It's awesome that you have weights just right within js file but I don't see training code, is it separated?
Will you publish training code?
I see that your implementation relies on HCE and not going to copypaste it,
I'm looking for learning the basics instead.
Can you suggest anything?
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

tomitank
Posts: 258
Joined: Sat Mar 04, 2017 11:24 am
Location: Hungary

Re: tomitankChess 5.0 with NN

Post by tomitank » Mon Jan 18, 2021 8:21 pm

maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Just played in the browser - very strange thing has happened - in Ruy Lopez exchange on c6 variation I had a position when knight on f6 was attacking pawn on e4. I've defended with d2d3 and than knight captured on e4. I played a few moves and got winning endgame. I'm very weal player, around 1700 Elo lichess. Was that a bug?
Which level you played? level 4 is the first that play with full force. (only with 0.5sec / move)
This version beatin Toga II 4.0 on my machine, i don't think that it's buggy. But the small network can make a mistake in some position.
maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Default English has gone from the browser mode - I can't read or change language.
Also before engine was hitting up to depth 15 and now it moves instantly for some reason, well probably I just missed the settings because of the non English interface.
Settings menu called "Beállítások" in Hungarian. Here can you change the language. (which browser are you using?)
maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Tamas, any chances to get a public tutorial in a format of a "paper" on how did you design/train your net?
I've been following your thread but the discussions there are too complicated.
So any chances to get decent absolute beginners materials on neural nets?

P.S. I'm especially intrigued by the tiny datasets you've been using, also your minimalist approach is very attractive.
Maybe later.
A few things:
I started from scratch.
I read this: http://neuralnetworksanddeeplearning.com/
Then I typed in google search: neural network from scratch in JavaScript.
I use math.js for matrices.

Happy coding!

supersharp77
Posts: 999
Joined: Sat Jul 05, 2014 5:54 am
Location: Southwest USA

Re: tomitankChess 5.0 with NN

Post by supersharp77 » Mon Jan 18, 2021 8:51 pm

tomitank wrote:
Mon Jan 18, 2021 7:36 pm
Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

- I have around 10 elo better net (768x32x1) in fix depth test, but JavaScript is too slow, and don’t have AVX or similar methode in JavaScript (so i use vanilla approach). Essentially the smaller net has nearly the same strength in both short and long TC tests.

The training method is similar to that described by Andrew, thanks to him for the explanation.
But the implementation is unique and I have not received any help.
http://talkchess.com/forum3/viewtopic.p ... 72#p874960

This net is not perfect, and HCE slows that down further, but i win around 60-70 or even more. (i don't tested deeply.) In C it would be around 140-150.

I can try to use more examples later, but it’s pretty boring for me.

I also plan to turn off HCE and use only NN, but (probably) the authors of Halogen do this better.

I tried to go my own way, so feel free to send this version to the CCRL list.

Estimated elo: near to 2900.

Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás
Nice Boast my friend but the bottom line is until we have a simple solution for running Tomitank and Lozza and Wukong JS and whoever else in the major GUi's (Fritz, Arena, Chess Ok or Shredder etc) we can't tell for sure...produce a exe so we can test! juci.exe does not seem to work.....Right now McBrain v9.6 JS.exe is the strongest Java or Javascript Chess engine in the WORLD.... :) :wink:

User avatar
maksimKorzh
Posts: 636
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: tomitankChess 5.0 with NN

Post by maksimKorzh » Mon Jan 18, 2021 9:08 pm

supersharp77 wrote:
Mon Jan 18, 2021 8:51 pm
tomitank wrote:
Mon Jan 18, 2021 7:36 pm
Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

- I have around 10 elo better net (768x32x1) in fix depth test, but JavaScript is too slow, and don’t have AVX or similar methode in JavaScript (so i use vanilla approach). Essentially the smaller net has nearly the same strength in both short and long TC tests.

The training method is similar to that described by Andrew, thanks to him for the explanation.
But the implementation is unique and I have not received any help.
http://talkchess.com/forum3/viewtopic.p ... 72#p874960

This net is not perfect, and HCE slows that down further, but i win around 60-70 or even more. (i don't tested deeply.) In C it would be around 140-150.

I can try to use more examples later, but it’s pretty boring for me.

I also plan to turn off HCE and use only NN, but (probably) the authors of Halogen do this better.

I tried to go my own way, so feel free to send this version to the CCRL list.

Estimated elo: near to 2900.

Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás
Nice Boast my friend but the bottom line is until we have a simple solution for running Tomitank and Lozza and Wukong JS and whoever else in the major GUi's (Fritz, Arena, Chess Ok or Shredder etc) we can't tell for sure...produce a exe so we can test! juci.exe does not seem to work.....Right now McBrain v9.6 JS.exe is the strongest Java or Javascript Chess engine in the WORLD.... :) :wink:
Is that so hard to download nodejs???
Is it so hard to specify 2 paths instead of one?
Path to node js instead of engine executable and path to js file as command line arg in Arena - that's it.
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

User avatar
Sylwy
Posts: 3574
Joined: Fri Apr 21, 2006 2:19 pm
Location: IASI (Romania) - the historical capital of MOLDOVA

Re: tomitankChess 5.0 with NN

Post by Sylwy » Mon Jan 18, 2021 9:10 pm

Hey, man ! Nice engine (like always :wink: ). Thank you ! Just I started a test-match (100 games, TC=4'+2"-12-15 minutes per game) with an 2900 (near) Elo points (CCRL Blitz) chess engine. Let's see the result !

Image

Image

User avatar
maksimKorzh
Posts: 636
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: tomitankChess 5.0 with NN

Post by maksimKorzh » Mon Jan 18, 2021 9:16 pm

tomitank wrote:
Mon Jan 18, 2021 8:21 pm
maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Just played in the browser - very strange thing has happened - in Ruy Lopez exchange on c6 variation I had a position when knight on f6 was attacking pawn on e4. I've defended with d2d3 and than knight captured on e4. I played a few moves and got winning endgame. I'm very weal player, around 1700 Elo lichess. Was that a bug?
Which level you played? level 4 is the first that play with full force. (only with 0.5sec / move)
This version beatin Toga II 4.0 on my machine, i don't think that it's buggy. But the small network can make a mistake in some position.
maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Default English has gone from the browser mode - I can't read or change language.
Also before engine was hitting up to depth 15 and now it moves instantly for some reason, well probably I just missed the settings because of the non English interface.
Settings menu called "Beállítások" in Hungarian. Here can you change the language. (which browser are you using?)
maksimKorzh wrote:
Mon Jan 18, 2021 8:03 pm
Tamas, any chances to get a public tutorial in a format of a "paper" on how did you design/train your net?
I've been following your thread but the discussions there are too complicated.
So any chances to get decent absolute beginners materials on neural nets?

P.S. I'm especially intrigued by the tiny datasets you've been using, also your minimalist approach is very attractive.
Maybe later.
A few things:
I started from scratch.
I read this: http://neuralnetworksanddeeplearning.com/
Then I typed in google search: neural network from scratch in JavaScript.
I use math.js for matrices.

Happy coding!
Thanks for sharing resources!
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

User avatar
Graham Banks
Posts: 35090
Joined: Sun Feb 26, 2006 9:52 am
Location: Auckland, NZ

Re: tomitankChess 5.0 with NN

Post by Graham Banks » Mon Jan 18, 2021 9:35 pm

supersharp77 wrote:
Mon Jan 18, 2021 8:51 pm
tomitank wrote:
Mon Jan 18, 2021 7:36 pm
Hi all!

Here is the new version of world stongest JavaScript chess engine!

This is quite different from the SF solution.

- network is only 768x16x1. Smaller than I've seen before.

- it does not replace evaluation, it only compensates that. (*)

- trained only with 2.7M example.

- The network is not compatible with other engines (*) and it's integrated into the code. (hardcoded)

- I wrote the network from scratch. I don't use machine learning platform.

- I have around 10 elo better net (768x32x1) in fix depth test, but JavaScript is too slow, and don’t have AVX or similar methode in JavaScript (so i use vanilla approach). Essentially the smaller net has nearly the same strength in both short and long TC tests.

The training method is similar to that described by Andrew, thanks to him for the explanation.
But the implementation is unique and I have not received any help.
http://talkchess.com/forum3/viewtopic.p ... 72#p874960

This net is not perfect, and HCE slows that down further, but i win around 60-70 or even more. (i don't tested deeply.) In C it would be around 140-150.

I can try to use more examples later, but it’s pretty boring for me.

I also plan to turn off HCE and use only NN, but (probably) the authors of Halogen do this better.

I tried to go my own way, so feel free to send this version to the CCRL list.

Estimated elo: near to 2900.

Since JavaScript is about 4-5x slower than C, it would be around 3100 or above in C. (With AVX).

JavaScript uses only one core. With 4 cores, in C it would be near to 3300.

I did not tune the search. It could probably be even stronger.

Its run in Browser or in Chess GUIs with node.js as well.

Url:
https://github.com/tomitank/tomitankChess

I welcome any feedback.

Have fun with tomitankChess!

-Tamás
Nice Boast my friend but the bottom line is until we have a simple solution for running Tomitank and Lozza and Wukong JS and whoever else in the major GUi's (Fritz, Arena, Chess Ok or Shredder etc) we can't tell for sure...produce a exe so we can test! juci.exe does not seem to work.....Right now McBrain v9.6 JS.exe is the strongest Java or Javascript Chess engine in the WORLD.... :) :wink:
Use ChessGUI - no issues with java engines.
gbanksnz at gmail.com

Dann Corbit
Posts: 12040
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: tomitankChess 5.0 with NN

Post by Dann Corbit » Mon Jan 18, 2021 9:39 pm

Is it also true of Javascript engines?
Not the same thing.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Gabor Szots
Posts: 763
Joined: Sat Jul 21, 2018 5:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: tomitankChess 5.0 with NN

Post by Gabor Szots » Tue Jan 19, 2021 7:37 am

supersharp77 wrote:
Mon Jan 18, 2021 8:51 pm
Nice Boast my friend but the bottom line is until we have a simple solution for running Tomitank and Lozza and Wukong JS and whoever else in the major GUi's (Fritz, Arena, Chess Ok or Shredder etc) we can't tell for sure...produce a exe so we can test! juci.exe does not seem to work...
Copy node.exe to the tomitankChess directory then use it as the engine with the js file as parameter.

Works under Arena and Shredder. Fritz is hopeless though.
Gabor Szots
CCRL testing group

Post Reply