A random walk down NNUE street ….

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

Moderators: hgm, Rebel, chrisw

jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: A random walk down NNUE street ….

Post by jp »

smatovic wrote: Fri Mar 12, 2021 10:36 am
jp wrote: Fri Mar 12, 2021 9:18 am I'm saying you won't be able to come up with an algorithm, like e.g. alpha-beta for classical computer chess. Forget about machines to run alpha-beta on. Forget about computer languages to write it in. If the "alpha-beta" does not exist, those things are irrelevant. You need the algorithm first, specified the way we can specify alpha-beta architecture-independently and language-independently.

No one has come up with an algorithm and no one will be able to.
So in which language, code, program, calculus, math you would accept my project "Iota", a perfect play TicTacToe engine for quantum-computers?
It just needs to be specified mathematically precisely. Pseudo-code would be fine.

e.g. for classical quicksort

Code: Select all

Quicksort(A,p,r) {
    if (p < r) {
       q <- Partition(A,p,r)
       Quicksort(A,p,q)
       Quicksort(A,q+1,r)
    }
}

Partition(A,p,r)
    x <- A[p]
    i <- p-1
    j <- r+1
    while (True) {
        repeat
            j <- j-1
        until (A[j] <= x)
        repeat
            i <- i+1
        until (A[i] >= x)
        if (i A[j]
        else 
            return(j)
    }
}
One of course then needs to analyse quicksort's performance. You could say we determine best-case, average-case performance, etc. in the "classical circuit model". We are certainly not thinking of specific languages or architectures when we are analysing quicksort. Likewise, we have the "quantum circuit model". The different models of quantum computation are equivalent.

The algorithm does need to outperform classical algorithms in some way, of course. Otherwise, we could just write a "quantum" algorithm that just does classical computation.
smatovic
Posts: 2645
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: A random walk down NNUE street ….

Post by smatovic »

jp wrote: Sat Mar 13, 2021 5:17 am
smatovic wrote: Fri Mar 12, 2021 10:36 am
jp wrote: Fri Mar 12, 2021 9:18 am I'm saying you won't be able to come up with an algorithm, like e.g. alpha-beta for classical computer chess. Forget about machines to run alpha-beta on. Forget about computer languages to write it in. If the "alpha-beta" does not exist, those things are irrelevant. You need the algorithm first, specified the way we can specify alpha-beta architecture-independently and language-independently.

No one has come up with an algorithm and no one will be able to.
So in which language, code, program, calculus, math you would accept my project "Iota", a perfect play TicTacToe engine for quantum-computers?
It just needs to be specified mathematically precisely. Pseudo-code would be fine.

e.g. for classical quicksort

Code: Select all

Quicksort(A,p,r) {
    if (p < r) {
       q <- Partition(A,p,r)
       Quicksort(A,p,q)
       Quicksort(A,q+1,r)
    }
}

Partition(A,p,r)
    x <- A[p]
    i <- p-1
    j <- r+1
    while (True) {
        repeat
            j <- j-1
        until (A[j] <= x)
        repeat
            i <- i+1
        until (A[i] >= x)
        if (i A[j]
        else 
            return(j)
    }
}
One of course then needs to analyse quicksort's performance. You could say we determine best-case, average-case performance, etc. in the "classical circuit model". We are certainly not thinking of specific languages or architectures when we are analysing quicksort. Likewise, we have the "quantum circuit model". The different models of quantum computation are equivalent.

The algorithm does need to outperform classical algorithms in some way, of course. Otherwise, we could just write a "quantum" algorithm that just does classical computation.
Okay JP, I take this as a challenge, project Iota is in my pipe again :) will take some time.

--
Srdja
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

As I continue my random walk down NNUE Street - my first (and last?) net release.

Lightly trained at 25 million positions with depths of 4 thru 12. All self generated fens using the NodChip Stockfish app.
It is a very weak net relative to other nets one may find on the internet. With Stockfish , however, it will play at Grandmaster Elo, but perhaps not in the style a Grandmaster will play.
Totally 100% AI developed, I did not use any other developed nets in developing this net nor did I use the zillions of fens or pgn games available.
All of training done so so far was with with NNUE setting of "Pure" , and most of training was done with lambda set to 0 (zero) with few runs with lambda set to 0.5 or 1;. This was also started with a fresh NNUE (totally random net).
This was just a little dive, no guarantee I will ever develop/release another one.

You may enjoy playing this net or you may not, I would certainly not use it for analysis!

https://github.com/MichaelB7/droidfish/ ... v13/mb.bin
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

MikeB wrote: Tue Mar 16, 2021 6:56 am As I continue my random walk down NNUE Street - my first (and last?) net release.

Lightly trained at 25 million positions with depths of 4 thru 12. All self generated fens using the NodChip Stockfish app.
It is a very weak net relative to other nets one may find on the internet. With Stockfish , however, it will play at Grandmaster Elo, but perhaps not in the style a Grandmaster will play.
Totally 100% AI developed, I did not use any other developed nets in developing this net nor did I use the zillions of fens or pgn games available.
All of training done so so far was with with NNUE setting of "Pure" , and most of training was done with lambda set to 0 (zero) with few runs with lambda set to 0.5 or 1;. This was also started with a fresh NNUE (totally random net).
This was just a little dive, no guarantee I will ever develop/release another one.

You may enjoy playing this net or you may not, I would certainly not use it for analysis!

https://github.com/MichaelB7/droidfish/ ... v13/mb.bin
An example game , using the above net with time control game 6 seconds and one second increment. Very beatable by an average club player at this tc even when playing full strength - yet able to hold its own against Zappa Mexico II at game 1 min with 1 second increment.

I made some moves here on purpose to see how the net would respond .
5. h3 ?
20. Bxa7 ?
28. b4 ?


[pgn][Event "Computer Chess Game"]
[Site "VM-894787"]
[Date "2021.03.16"]
[Round "-"]
[White "MichaelB7"]
[Black "Stockfish 13"]
[Result "*"]
[TimeControl "60+10"]
[Annotator "1... -0.22"]

1. e4 d5 {-0.22/16 2.1} 2. exd5 e6 {-0.22/16 2.2} 3. dxe6 Bxe6
{-0.21/16 0.3} 4. Nf3 Bg4 {-0.21/17 1.4} 5. h3 Qe7+ {-0.15/17 0.8} 6. Qe2
Bxf3 {-0.15/16 0.4} 7. Qxe7+ Nxe7 {-0.14/17 1.0} 8. gxf3 Nbc6
{-0.14/18 0.6} 9. c3 Nf5 {-0.15/19 0.9} 10. d4 Ncxd4 {-0.15/18 0.3} 11.
cxd4 Nxd4 {-0.14/19 0.6} 12. Bd3 Nxf3+ {-0.14/21 1.9} 13. Ke2 Rd8
{-0.12/21 4} 14. Kxf3 Rxd3+ {-0.13/17 0.4} 15. Kg2 Kd7 {-0.12/19 0.9} 16.
Be3 f5 {-0.12/19 0.8} 17. Nc3 Bd6 {-0.12/19 0.2} 18. Rhd1 Rxd1
{-0.11/19 0.5} 19. Rxd1 Re8 {-0.11/18 0.8} 20. Bxa7 b6 {-0.07/22 1.3} 21.
Bxb6 cxb6 {-0.06/17 0.3} 22. Nb5 Re6 {+0.00/18 0.5} 23. Nxd6 Rxd6
{+0.06/19 0.6} 24. Rxd6+ Kxd6 {+0.00/19 0.7} 25. Kf3 g5 {+0.06/22 1.2} 26.
h4 h6 {+0.00/22 0.5} 27. hxg5 hxg5 {+0.00/25 0.6} 28. b4 b5 {+0.07/30 0.7}
29. Ke3 Kd5 {+3.00/28 0.7} 30. Kd3 g4 {+6.37/26 0.8}
*[/pgn]
At this tc ,the net is playing reasonable moves, but obviously not over-powering for average club players.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

After updating my baby NNUE with a skimpy 25M depth 14 sfens, decided to see what happens if I applied what worked for me in building the baby net to the big boy bin, nn-62ef826d1a6d/nnue, the current SF network file, results below:

first pass:

Code: Select all

#########################################################################################################
###                                              Summary                                              ###
#########################################################################################################

PGN File: c:/cluster.mfb/pgn/03191832.pgn
Time Control: Time Control-> base+inc: 12+0.160
Games: 600
Threads: 1
Hash: 128

Current date : time (EDST)
Date: 03/19/21 : 18:45:38

Projected-> Time: 0h:14m:20s
     Run -> Time: 0h:13m:34s

600 game(s) loaded
Rank Name                    Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR
---------------------------------------------------------------------------------------------------------

   1 Stockfish-bdcb9b41bdac   3503   0.0   15   15   600  305.5  50.9   98   87  415  16.3  69.2  3497
   2 Stockfish-62ef826d1a6d   3497   6.4   15   15   600  294.5  49.1   87   98  415  14.5  69.2  3503
---------------------------------------------------------------------------------------------------------

  Δ = delta from the next higher rated opponent
  # = number of games played
  Σ = total score, 1 point for win, 1/2 point for draw

LOS:
                        St St
Stockfish-bdcb9b41bdac     79
Stockfish-62ef826d1a6d  20

#########################################################################################################
###                                                End                                                ###
#########################################################################################################
repeat and rinse:

Code: Select all

#########################################################################################################
###                                              Summary                                              ###
#########################################################################################################

PGN File: c:/cluster.mfb/pgn/03191925.pgn
Time Control: Time Control-> base+inc: 12+0.160
Games: 600
Threads: 1
Hash: 128

Current date : time (EDST)
Date: 03/19/21 : 19:39:07

Projected-> Time: 0h:14m:20s
     Run -> Time: 0h:13m:12s

600 game(s) loaded
Rank Name                    Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR
---------------------------------------------------------------------------------------------------------

   1 Stockfish-645458a823c7   3504   0.0   14   14   600  308.0  51.3   89   73  438  14.8  73.0  3496
   2 Stockfish-62ef826d1a6d   3496   9.0   14   14   600  292.0  48.7   73   89  438  12.2  73.0  3504
---------------------------------------------------------------------------------------------------------

  Δ = delta from the next higher rated opponent
  # = number of games played
  Σ = total score, 1 point for win, 1/2 point for draw

LOS:
                        St St
Stockfish-645458a823c7     89
Stockfish-62ef826d1a6d  10

#########################################################################################################
###                                                End                                                ###
#########################################################################################################
so it does appear that it may be possible to improve the SF current net, even with a skimpy M25_D14 binpack.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

I have had such decent results with my local testing, I have actually submitted my net for testing:

https://tests.stockfishchess.org/tests/ ... 8de7a38f81

Code: Select all

#########################################################################################################
###                                              Summary                                              ###
#########################################################################################################

PGN File: c:/cluster.mfb/pgn/03200849.pgn
Time Control: Time Control-> base+inc: 12+0.300
Games: 1800
Threads: 1
Hash: 128

Current date : time (EDST)
Date: 03/20/21 : 09:41:47

Projected-> Time: 0h:55m:47s
     Run -> Time: 0h:52m:29s

1800 game(s) loaded
Rank Name                    Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR
---------------------------------------------------------------------------------------------------------

   1 Stockfish-645458a823c7   3505   0.0   10   10  1200  613.5  51.1  167  140  893  13.9  74.4  3497
   2 Stockfish-62ef826d1a6d   3498   7.6   10   10  1200  593.5  49.5  161  174  865  13.4  72.1  3501
   3 Stockfish-df77245c32f7   3497   0.1   10   10  1200  593.0  49.4  158  172  870  13.2  72.5  3501
---------------------------------------------------------------------------------------------------------

  Δ = delta from the next higher rated opponent
  # = number of games played
  Σ = total score, 1 point for win, 1/2 point for draw

LOS:
                        St St St
Stockfish-645458a823c7     89 90
Stockfish-62ef826d1a6d  10    50
Stockfish-df77245c32f7   9 49

#########################################################################################################
###                                                End                                                ###
#########################################################################################################
and of course once you submit a net for testing, it can be freely downloaded from here:

https://tests.stockfishchess.org/nns

My experience with local testing versus fishtesting has not been very congruent in the past, perhaps this time it will be different...
Image
User avatar
AlexChess
Posts: 1502
Joined: Sat Feb 06, 2021 8:06 am
Full name: Alex Morales

Re: A random walk down NNUE street ….

Post by AlexChess »

Hi!
Your latest net 1f66... with the latest Stockfish dev seems really promising! :)

Image

Now I'll test also all the other top engines with it, tablebases 6-man and no opening book
Chess engines and dedicated chess computers fan since 1981 :D Mac mini M1 8GB-256GB, Windows 11 & Ubuntu ARM64.
ProteusSF Dev Forum TROLLS KINDERGARTEN
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

I guess this is a fitting epilog to my random walk down NNUE street:

https://github.com/official-stockfish/S ... /pull/3568

the latest and greatest Stockfish net .. until tomorrow perhaps..
Image
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: A random walk down NNUE street ….

Post by kranium »

MikeB wrote: Fri Jun 18, 2021 11:54 pm I guess this is a fitting epilog to my random walk down NNUE street:

https://github.com/official-stockfish/S ... /pull/3568

the latest and greatest Stockfish net .. until tomorrow perhaps..
wow nice work Michael :!: