Didactical neural nets

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

Moderators: hgm, Rebel, chrisw

glav
Posts: 45
Joined: Sun Apr 07, 2019 1:10 am
Full name: Giovanni Lavorgna

Didactical neural nets

Post by glav »

I would like to learn how neural nets have replaced the hand tuned values of the engine's evaluation functions. However, present neural nets have grown too big and I am afraid also that the complexity of generating them would be too much for me (and for my hardware). So, I thought that I could start from a simpler position, say rook + king vs. king alone. Is there already someone who has done something similar for didactical purposes? Also, if I should build it myself where I should start from?
User avatar
hgm
Posts: 27892
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Didactical neural nets

Post by hgm »

I don't think neural nets could do KRK, at least not with the standard training method. Because the latter only tries to teach the net how large the probability for winning is. Which in KRK is always 100% (with white to move). The important thing you need to know for playing KRK is how long it will take to win from a given position, not what your winning chances are.

Of course an engine that searches deep enough might be able to find the checkmate in KRK even without any evaluation.
glav
Posts: 45
Joined: Sun Apr 07, 2019 1:10 am
Full name: Giovanni Lavorgna

Re: Didactical neural nets

Post by glav »

Thanks for your answer. Then, how about the following ending (Fischer- Taimanov, 1970)? It is a relatively more complex position, where commentators saw a White advantage, mainly due to the fact that Bishop is better than the Knight. Would it be possible (and simpler) to build a neural net from this position?

[d]7r/3k1pp1/pp3n1p/2p1R3/5P2/6P1/PPP3BP/6K1 w - - 0 25
jefk
Posts: 675
Joined: Sun Jul 25, 2010 10:07 pm
Location: the Netherlands
Full name: Jef Kaan

Re: Didactical neural nets

Post by jefk »

some decades ago the Dutchman Alex van Tiggelen did research on such endgame nets and did a Phd
about the topic (in that time much simpler than nowadays, but apparently he was in the right direction:
https://www.chessprogramming.org/Alex_van_Tiggelen
note there was some discussion about the complete program (Alexs) has having copied
some stuff from another engine (Nightmare) but that's beyond your topic
brianr
Posts: 537
Joined: Thu Mar 09, 2006 3:01 pm

Re: Didactical neural nets

Post by brianr »

hgm wrote: Tue Jun 11, 2024 3:16 pm I don't think neural nets could do KRK, at least not with the standard training method.
Older CNN format NNs with Lc0 as small as 8x1 can easily learn KRvK.
At least the nets can mate with Lc0 doing some searching, FWIW.
Note that this type of net is not the same as the Stockfish NNs.
I could not train nets to mate with KBNvK however.
User avatar
hgm
Posts: 27892
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Didactical neural nets

Post by hgm »

A conventional evaluation with only piece-square tables is also a neural net, a very simple one. And penalizing the bare Kingfor approaching the corner of the shade of the Bishop should be enough to make an engine win KBNK even with very shallow thinking. So it is strange that you could not train it. It must be due to the training method.