mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 01:59:36 +00:00

train a net using training data with a heavier weight on positions having 16 pieces on the board. More specifically, with a relative weight of `i * (32-i)/(16 * 16)+1` (where i is the number of pieces on the board). This is done with the trainer branch https://github.com/glinscott/nnue-pytorch/pull/173 The command used is: ``` python train.py $datafile $datafile $restarttype $restartfile --gpus 1 --threads 4 --num-workers 12 --random-fen-skipping=3 --batch-size 16384 --progress_bar_refresh_rate 300 --smart-fen-skipping --features=HalfKAv2_hm^ --lambda=1.00 --max_epochs=$epochs --seed $RANDOM --default_root_dir exp/run_$i ``` The datafile is T60T70wIsRightFarseerT60T74T75T76.binpack, the restart is from the master net. passed STC: LLR: 2.94 (-2.94,2.94) <0.00,2.50> Total: 22728 W: 6197 L: 5945 D: 10586 Ptnml(0-2): 105, 2453, 6001, 2695, 110 https://tests.stockfishchess.org/tests/view/625cf944ff677a888877cd90 passed LTC: LLR: 2.94 (-2.94,2.94) <0.50,3.00> Total: 35664 W: 9535 L: 9264 D: 16865 Ptnml(0-2): 30, 3524, 10455, 3791, 32 https://tests.stockfishchess.org/tests/view/625d3c32ff677a888877d7ca closes https://github.com/official-stockfish/Stockfish/pull/3989 Bench: 7269563
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/*
|
|
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
|
|
Copyright (C) 2004-2022 The Stockfish developers (see AUTHORS file)
|
|
|
|
Stockfish is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Stockfish is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef EVALUATE_H_INCLUDED
|
|
#define EVALUATE_H_INCLUDED
|
|
|
|
#include <string>
|
|
#include <optional>
|
|
|
|
#include "types.h"
|
|
|
|
namespace Stockfish {
|
|
|
|
class Position;
|
|
|
|
namespace Eval {
|
|
|
|
std::string trace(Position& pos);
|
|
Value evaluate(const Position& pos);
|
|
|
|
extern bool useNNUE;
|
|
extern std::string currentEvalFileName;
|
|
|
|
// The default net name MUST follow the format nn-[SHA256 first 12 digits].nnue
|
|
// for the build process (profile-build and fishtest) to work. Do not change the
|
|
// name of the macro, as it is used in the Makefile.
|
|
#define EvalFileDefaultName "nn-d0b74ce1e5eb.nnue"
|
|
|
|
namespace NNUE {
|
|
|
|
std::string trace(Position& pos);
|
|
Value evaluate(const Position& pos, bool adjusted = false);
|
|
|
|
void init();
|
|
void verify();
|
|
|
|
bool load_eval(std::string name, std::istream& stream);
|
|
bool save_eval(std::ostream& stream);
|
|
bool save_eval(const std::optional<std::string>& filename);
|
|
|
|
} // namespace NNUE
|
|
|
|
} // namespace Eval
|
|
|
|
} // namespace Stockfish
|
|
|
|
#endif // #ifndef EVALUATE_H_INCLUDED
|