tomitankChess 5.0 with NN

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

Moderators: hgm, Rebel, chrisw

tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

tomitankChess 5.0 with NN

Post by tomitank »

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: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: tomitankChess 5.0 with NN

Post by maksimKorzh »

tomitank wrote: Mon Jan 18, 2021 8: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?
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: tomitankChess 5.0 with NN

Post by tomitank »

maksimKorzh wrote: Mon Jan 18, 2021 9: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 9: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 9: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: 1242
Joined: Sat Jul 05, 2014 7:54 am
Location: Southwest USA

Re: tomitankChess 5.0 with NN

Post by supersharp77 »

tomitank wrote: Mon Jan 18, 2021 8: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: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: tomitankChess 5.0 with NN

Post by maksimKorzh »

supersharp77 wrote: Mon Jan 18, 2021 9:51 pm
tomitank wrote: Mon Jan 18, 2021 8: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.
User avatar
Sylwy
Posts: 4466
Joined: Fri Apr 21, 2006 4:19 pm
Location: IASI - the historical capital of MOLDOVA
Full name: SilvianR

Re: tomitankChess 5.0 with NN

Post by Sylwy »

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: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: tomitankChess 5.0 with NN

Post by maksimKorzh »

tomitank wrote: Mon Jan 18, 2021 9:21 pm
maksimKorzh wrote: Mon Jan 18, 2021 9: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 9: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 9: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!
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: tomitankChess 5.0 with NN

Post by Graham Banks »

supersharp77 wrote: Mon Jan 18, 2021 9:51 pm
tomitank wrote: Mon Jan 18, 2021 8: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: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: tomitankChess 5.0 with NN

Post by Dann Corbit »

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: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: tomitankChess 5.0 with NN

Post by Gabor Szots »

supersharp77 wrote: Mon Jan 18, 2021 9:51 pmNice 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