aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-03-27 23:59:33 -0400
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit35dc86f8476250f693aa419f404b2b4c8c381d92 (patch)
tree678cd42cdbf0e46662dd2e71694e6c496d8e2279 /src
parent00a04c2929bdc8f8f4bf7d5d8cf413ebfb3cd006 (diff)
Playing around with huge nn's, poorly trained.sixes
Not great at shallow depths
Diffstat (limited to 'src')
-rw-r--r--src/ctlm.c10
-rw-r--r--src/pptdb.c6
2 files changed, 7 insertions, 9 deletions
diff --git a/src/ctlm.c b/src/ctlm.c
index b9deb15..0288be8 100644
--- a/src/ctlm.c
+++ b/src/ctlm.c
@@ -384,7 +384,7 @@ input_is_not_turn(const char *line) {
} else if (!strcmp(line,"log")) {
puts(gamelog);
} else if (!strcmp(line,"new")) {
- new_game(5);
+ new_game(6);
} else if (!strcmp(line,"tps")) {
char buf[1000];
generate_tps(buf);
@@ -433,7 +433,7 @@ input_is_not_turn(const char *line) {
|| (line[5] == 'w' || line[5] == 'W'))) {
// 'b' is even :)
human = 1 - (line[5] & 1);
- new_game(5);
+ new_game(6);
} else {
puts("Usage: play (b|w).");
}
@@ -455,9 +455,9 @@ int main(int argc, char **argv) {
puts(license);
- negamax_search_depth = 5;
- new_game(5);
- negamax_init(5);
+ negamax_search_depth = 4;
+ new_game(6);
+ negamax_init(6);
// Test harness
if (argc > 1) {
diff --git a/src/pptdb.c b/src/pptdb.c
index 8684c47..c64ea2c 100644
--- a/src/pptdb.c
+++ b/src/pptdb.c
@@ -29,8 +29,6 @@ uint64_t heights[16];
FILE *training_fh = NULL;
float max_flats, outcome_black;
-const int max_depth = 6;
-
static void
write_input(const int dx, const int dy, const uint8_t swap) {
// Two numbers for flats remaining
@@ -41,7 +39,7 @@ write_input(const int dx, const int dy, const uint8_t swap) {
// Write the board layers
float val;
int col, row;
- for (uint8_t depth = 0; depth < max_depth; depth++) {
+ for (uint8_t depth = 0; depth < board_size+1; depth++) {
row = (dy>0)?-1:board_size;
for (int i = 0; i < board_size; i++) {
row += dy;
@@ -136,7 +134,7 @@ parse_line(const char *pt, const ssize_t read) {
}
// Generate training data, not too early in the game, all
// orientations
- if (generate && ply + 3 >= total_plies) {
+ if (generate && ply < total_plies && ply + 2 >= total_plies) {
#define RANDPM1 ((rand()&1)?-1:+1)
write_input(RANDPM1, RANDPM1, rand()&1);
}