The advantages of NN Learning engines..........

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

Moderators: hgm, Rebel, chrisw

Chessqueen
Posts: 5581
Joined: Wed Sep 05, 2018 2:16 am
Location: Moving
Full name: Jorge Picado

The advantages of NN Learning engines..........

Post by Chessqueen »

I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
Do NOT worry and be happy, we all live a short life :roll:
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: The advantages of NN Learning engines..........

Post by D Sceviour »

Chessqueen wrote: Tue Aug 20, 2019 2:34 pm I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
Yes. It is called an opening book. Polyglot is the most common book, but other engines such as Crafty have their own book. Bob Hyatt experimented with other learning files, but I do not know how successful they were.
marsell
Posts: 106
Joined: Tue Feb 07, 2012 11:14 am

Re: The advantages of NN Learning engines..........

Post by marsell »

Chessqueen wrote: Tue Aug 20, 2019 2:34 pm I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
1. I always thought NN Engines only learn in training and not in game play or analyzing mode.
2. How does the NN Engine know which move loses? Or it was just a suboptimal one.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: The advantages of NN Learning engines..........

Post by zullil »

marsell wrote: Tue Aug 20, 2019 3:32 pm
Chessqueen wrote: Tue Aug 20, 2019 2:34 pm I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
1. I always thought NN Engines only learn in training and not in game play or analyzing mode.
I believe you are correct. I don't believe any version of Lc0 alters a weights file or creates a "learning file". But I'm not an expert. Then again, the original poster is not known for providing correct (or useful) posts, in my opinion.
Chessqueen
Posts: 5581
Joined: Wed Sep 05, 2018 2:16 am
Location: Moving
Full name: Jorge Picado

Re: The advantages of NN Learning engines..........

Post by Chessqueen »

zullil wrote: Tue Aug 20, 2019 4:08 pm
marsell wrote: Tue Aug 20, 2019 3:32 pm
Chessqueen wrote: Tue Aug 20, 2019 2:34 pm I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
1. I always thought NN Engines only learn in training and not in game play or analyzing mode.
I believe you are correct. I don't believe any version of Lc0 alters a weights file or creates a "learning file". But I'm not an expert. Then again, the original poster is not known for providing correct (or useful) posts, in my opinion.
I used the wrong word, this is what I did I took a chess opening and decided from the very beginning to only play with this opening and with the same side not Lczero playing Black and then white. Lczero always played with the black side. The first game stockfish won, then the second time around Stockfish won again. ( Here is where I used the wrong term not that LCZero analyze the opening and found out where the bad move was chosen after the end of the opening), but instead I fed both SF and LC0 the same opening again for the third the fourth and the fifth time, and somehow LCZero after the opening decided not to make the exact moves that it made in the previous first two games that it lost, but instead it made different moves NOT replicating the exact games even if Stockfish played the exact moves that it did before, and once it found that the outcome of the third game has a winning line it kept on repeating the exact moves against stockfish which stockfish played the exact losing moves again in the fourth and once again in the 5th game. Somehow once LCZero found the correct sequence of moves it simply repeated as long as Stockfish repeated the same replying moves. I do not know if it has something to do with the implemented general reinforcement learning Algorithm, but it seems to work like a human GM that if a sequence of moves give it a winning game as long as the opponent continue playing the exact moves the human GM will also play the same line that it found on game 3, 4 and 5th. This general reinforcement learning algorithm is what makes Leela beat Stockfish when it plays the same opening more than once when you have a long match over 100 games.
Do NOT worry and be happy, we all live a short life :roll:
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: The advantages of NN Learning engines..........

Post by Guenther »

Chessqueen wrote: Tue Aug 20, 2019 6:18 pm
zullil wrote: Tue Aug 20, 2019 4:08 pm
marsell wrote: Tue Aug 20, 2019 3:32 pm
Chessqueen wrote: Tue Aug 20, 2019 2:34 pm I forced LCZero to play the same opening 5 times and after it lost the first two games I gave it to analyze and when it play from the 3rd game on it avoided playing the same losing moves which made it to lose against Stockfish and it won game 3, 4 and 5.

PS: I was wondering if ab engines have this capability that after it analyze the games that it lost it avoid making the same losing move again.?
1. I always thought NN Engines only learn in training and not in game play or analyzing mode.
I believe you are correct. I don't believe any version of Lc0 alters a weights file or creates a "learning file". But I'm not an expert. Then again, the original poster is not known for providing correct (or useful) posts, in my opinion.
I used the wrong word, this is what I did I took a chess opening and decided from the very beginning to only play with this opening and with the same side not Lczero playing Black and then white. Lczero always played with the black side. The first game stockfish won, then the second time around Stockfish won again. ( Here is where I used the wrong term not that LCZero analyze the opening and found out where the bad move was chosen after the end of the opening), but instead I fed both SF and LC0 the same opening again for the third the fourth and the fifth time, and somehow LCZero after the opening decided not to make the exact moves that it made in the previous first two games that it lost, but instead it made different moves NOT replicating the exact games even if Stockfish played the exact moves that it did before, and once it found that the outcome of the third game has a winning line it kept on repeating the exact moves against stockfish which stockfish played the exact losing moves again in the fourth and once again in the 5th game. Somehow once LCZero found the correct sequence of moves it simply repeated as long as Stockfish repeated the same replying moves. I do not know if it has something to do with the implemented general reinforcement learning Algorithm, but it seems to work like a human GM that if a sequence of moves give it a winning game as long as the opponent continue playing the exact moves the human GM will also play the same line that it found on game 3, 4 and 5th. This general reinforcement learning algorithm is what makes Leela beat Stockfish when it plays the same opening more than once when you have a long match over 100 games.
You have it all wrong. It has no learning and no reinforcement learning either.
It was just randomness due to thinking time and whatever happened on your machine.
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
dragontamer5788
Posts: 201
Joined: Thu Jun 06, 2019 8:05 pm
Full name: Percival Tiglao

Re: The advantages of NN Learning engines..........

Post by dragontamer5788 »

The main advantage of NN engines is the ability to operate on a 100 TFlop machines that cost under $1000.

Typical CPUs, even with 32-cores and SIMD optimizations, only achieve maybe 0.5 TFlops, 200x slower than a GPU. GPUs however, are hard to program. NNs are a hammer to utilize GPU-compute (GPUs, especially NVidia's Tensor Cores, can efficiently implement a NN convolve operations).
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: The advantages of NN Learning engines..........

Post by brianr »

Guenther wrote: Tue Aug 20, 2019 6:26 pm You have it all wrong. It has no learning and no reinforcement learning either.
It was just randomness due to thinking time and whatever happened on your machine.
I certainly defer to the Lc0 experts, but I think the default mode with Leela is not to clear memory tables between games. Of course this is not learning, but it does skew things. For example, if you run a match with two identical copies of Lc0 and a book with say 2 moves depth, one engine will tend to look stronger than another. However, if you re-run the match and force your tourney manager to restart the Lc0 instances each game, you will see that it stays almost exactly even, rarely if ever with one engine ahead of the other by more than one game.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: The advantages of NN Learning engines..........

Post by zullil »

brianr wrote: Tue Aug 20, 2019 10:47 pm
Guenther wrote: Tue Aug 20, 2019 6:26 pm You have it all wrong. It has no learning and no reinforcement learning either.
It was just randomness due to thinking time and whatever happened on your machine.
I certainly defer to the Lc0 experts, but I think the default mode with Leela is not to clear memory tables between games.
Here's what Lc0 does in response to the "ucinewgame" command:

Code: Select all

void EngineController::NewGame() {
  // In case anything relies upon defaulting to default position and just calls
  // newgame and goes straight into go.
  move_start_time_ = std::chrono::steady_clock::now();
  SharedLock lock(busy_mutex_);
  cache_.Clear();
  search_.reset();
  tree_.reset();
  time_spared_ms_ = 0;
  current_position_.reset();
  UpdateFromUciOptions();
}
And here's what the UCI specs say about that command:
ucinewgame
this is sent to the engine when the next search (started with "position" and "go") will be from
a different game. This can be a new game the engine should play or a new game it should analyse but
also the next position from a testsuite with positions only.
If the GUI hasn't sent a "ucinewgame" before the first "position" command, the engine shouldn't
expect any further ucinewgame commands as the GUI is probably not supporting the ucinewgame command.
So the engine should not rely on this command even though all new GUIs should support it.
As the engine's reaction to "ucinewgame" can take some time the GUI should always send "isready"
after "ucinewgame" to wait for the engine to finish its operation.
So, if Lc0 is not reset between games, it's the fault of the GUI, not a design choice of the engine programmers.