Search found 712 matches

by Rein Halbersma
Mon Mar 08, 2021 9:23 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: C++ code for board[8][8] representation
Replies: 4
Views: 181

Re: C++ code for board[8][8] representation

Code: Select all

#include <array>
  
constexpr auto mapping = [] {
    std::array<int, 128> ret{};
    ret['K'] = 1;
    ret['Q'] = 2;
    return ret;
}();
Or you can just use an immediately invoked lambda expression ;-)
by Rein Halbersma
Fri Feb 12, 2021 7:31 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Thought bitboards was faster :-)
Replies: 38
Views: 2819

Re: Thought bitboards was faster :-)

Using compiler explorer (I don't have latest MSVC installed), it seems MSVC add a test for popcount, and other <bit> functions. int bitcount(uint64_t b) { return std::popcount<uint64_t>(b); } Small nitpick: it's almost never necessary to help the compiler by providing explicit template arguments. Y...
by Rein Halbersma
Tue Feb 02, 2021 9:19 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: None-GPL NNUE probing code.
Replies: 21
Views: 2681

Re: None-GPL NNUE probing code.

NNUE architecture learns king safety and attack very quickly but something simple as piece values maybe hard without factorizer, or having it as input directly. NNUE is just a tiny net, no magic in it. I feel like a 2x32 conv net I have can compete with it but I need to write a fast inference code ...
by Rein Halbersma
Wed Jan 27, 2021 12:46 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: EGT generation when perpetual check is a loss
Replies: 2
Views: 750

Re: EGT generation when perpetual check is a loss

Isn't it more economical to handle perpetual checks as a post-processing step after the regular EGT generation instead of after every iteration? Here's what I do with the public information subset of Stratego endgames (not yet published) where perpetual chasing is forbidden. First, generate an EGT i...
by Rein Halbersma
Tue Jan 26, 2021 6:15 pm
Forum: Computer Chess Club: General Topics
Topic: correspondence chess in the age of NNUE
Replies: 121
Views: 16142

Re: correspondence chess in the age of NNUE

I suppose the actual wording should read something like: If a move is played that repeats the position for the third time, either player may call it a repetition, with the repeating side getting 1/4 point, the other side 3/4 point. For engine vs. engine play I suppose it would be automatically scor...
by Rein Halbersma
Fri Jan 22, 2021 10:18 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: More experiments with neural nets
Replies: 11
Views: 4002

Re: More experiments with neural nets

For training I use C++ with libTorch. I've been experimenting with PyTorch, the data-loader from PyTorch is so slow that it is unusable. Writing a data-loader in Python is not done either, I've never seen a language as slow as PyThon, It makes me wonder why most data-scientists insist on using this...
by Rein Halbersma
Fri Jan 22, 2021 9:10 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: More experiments with neural nets
Replies: 11
Views: 4002

Re: More experiments with neural nets

Interesting read! Do you use any random exploration during the training games? (like AlphaZero did in the opening). Oh, and did I read that correctly that you have extended cutechess-cli to also work with 8x8 checkers and Othello? I once tried that, IIRC, there was some documentation on how you can ...
by Rein Halbersma
Tue Jan 19, 2021 2:59 pm
Forum: Computer Chess Club: General Topics
Topic: It's NNUE era (sharing my thoughts)
Replies: 35
Views: 4473

Re: It's NNUE era (sharing my thoughts)

In a few months, everyone will be looking for ways to goose the nets — through size, architecture, etc. Those that use existing tools like tensorflow and pytorch instead of developing them from scratch will win the race(s). Writing gradient descent optimizers by hand never was a viable long term st...
by Rein Halbersma
Sun Jan 17, 2021 1:16 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Keras/Tensforflow for very sparse inputs
Replies: 3
Views: 796

Re: Keras/Tensforflow for very sparse inputs

Nice, I actually saw that post before. Couldn't ask on that forum because my account is still inactivated :P. So in your training data you have only the indexes? Yes, as described in that forum post, each pattern can take on 3**8 values, and each position only has one active pattern instance stored...
by Rein Halbersma
Sat Jan 16, 2021 10:40 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Keras/Tensforflow for very sparse inputs
Replies: 3
Views: 796

Re: Keras/Tensforflow for very sparse inputs

I have done something very similar in 10x10 draughts, explained here: http://laatste.info/bb3/viewtopic.php?f=53&t=8327
The key is understanding tf.gather and tf.reduce_sum