You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this refines the loss function to the form used for the new master net in official-stockfish/Stockfish#4100
The new loss function uses the expect game score to learn,
making the the learning more sensitive to those scores between loss and draw, draw and win.
Most visible for smaller values of the scaling parameter, but the current ones have been optimized.
it also introduces param_index for simpler explorations of paramers, i.e. simple parameter scans.
Copy file name to clipboardExpand all lines: train.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,7 @@ def main():
56
56
parser.add_argument("--save-last-network", type=str2bool, default=True, dest='save_last_network', help="Whether to always save the last produced network.")
57
57
parser.add_argument("--epoch-size", type=int, default=100000000, dest='epoch_size', help="Number of positions per epoch.")
58
58
parser.add_argument("--validation-size", type=int, default=1000000, dest='validation_size', help="Number of positions per validation step.")
59
+
parser.add_argument("--param-index", type=int, default=0, dest='param_index', help="Indexing for parameter scans.")
59
60
features.add_argparse_args(parser)
60
61
args=parser.parse_args()
61
62
@@ -79,7 +80,8 @@ def main():
79
80
max_epoch=max_epoch,
80
81
end_lambda=end_lambda,
81
82
gamma=args.gamma,
82
-
lr=args.lr
83
+
lr=args.lr,
84
+
param_index=args.param_index
83
85
)
84
86
else:
85
87
nnue=torch.load(args.resume_from_model)
@@ -91,6 +93,7 @@ def main():
91
93
# from .pt the optimizer is only created after the training is started
92
94
nnue.gamma=args.gamma
93
95
nnue.lr=args.lr
96
+
nnue.param_index=args.param_index
94
97
95
98
print("Feature set: {}".format(feature_set.name))
96
99
print("Num real features: {}".format(feature_set.num_real_features))
0 commit comments