Joseph Redmon
2016-03-16 67794a52a1ca19275f186dbc21cb45c1a45d6b92
more go
1 files modified
9 ■■■■■ changed files
src/go.c 9 ●●●●● patch | view | raw | blame | history
src/go.c
@@ -176,7 +176,7 @@
    }
}
void test_go(char *filename, char *weightfile)
void test_go(char *filename, char *weightfile, int multi)
{
    network net = parse_network_cfg(filename);
    if(weightfile){
@@ -191,7 +191,7 @@
        float *output = network_predict(net, board);
        copy_cpu(19*19, output, 1, move, 1);
        int i;
#ifdef GPU
        if(multi){
        image bim = float_to_image(19, 19, 1, board);
        for(i = 1; i < 8; ++i){
            rotate_image_cw(bim, i);
@@ -209,7 +209,7 @@
            rotate_image_cw(bim, -i);
        }
        scal_cpu(19*19, 1./8., move, 1);
#endif
        }
        for(i = 0; i < 19*19; ++i){
            if(board[i]) move[i] = 0;
        }
@@ -282,8 +282,9 @@
    char *cfg = argv[3];
    char *weights = (argc > 4) ? argv[4] : 0;
    int multi = find_arg(argc, argv, "-multi");
    if(0==strcmp(argv[2], "train")) train_go(cfg, weights);
    else if(0==strcmp(argv[2], "test")) test_go(cfg, weights);
    else if(0==strcmp(argv[2], "test")) test_go(cfg, weights, multi);
}