darknet  v3
Classes | Typedefs | Functions | Variables
go.c File Reference
#include "darknet.h"
#include <assert.h>
#include <math.h>
#include <unistd.h>
Include dependency graph for go.c:

Go to the source code of this file.

Classes

struct  moves
 
struct  mcts_tree
 
struct  move
 

Typedefs

typedef struct mcts_tree mcts_tree
 

Functions

int legal_go (float *b, float *ko, int p, int r, int c)
 
int check_ko (float *x, float *ko)
 
char * fgetgo (FILE *fp)
 
moves load_go_moves (char *filename)
 
void string_to_board (char *s, float *board)
 
void board_to_string (char *s, float *board)
 
data random_go_moves (moves m, int n)
 
void train_go (char *cfgfile, char *weightfile, char *filename, int *gpus, int ngpus, int clear)
 
void print_board (FILE *stream, float *board, int player, int *indexes)
 
void flip_board (float *board)
 
float predict_move2 (network *net, float *board, float *move, int multi)
 
void move_go (float *b, int p, int r, int c)
 
int compare_board (float *a, float *b)
 
void free_mcts (mcts_tree *root)
 
float * network_predict_rotations (network *net, float *next)
 
mcts_treeexpand (float *next, float *ko, network *net)
 
float * copy_board (float *board)
 
float select_mcts (mcts_tree *root, network *net, float *prev, float cpuct)
 
mcts_treerun_mcts (mcts_tree *tree, network *net, float *board, float *ko, int player, int n, float cpuct, float secs)
 
mcts_treemove_mcts (mcts_tree *tree, int index)
 
move pick_move (mcts_tree *tree, float temp, int player)
 
int suicide_go (float *b, int p, int r, int c)
 
void valid_go (char *cfgfile, char *weightfile, int multi, char *filename)
 
int print_game (float *board, FILE *fp)
 
int stdin_ready ()
 
mcts_treeponder (mcts_tree *tree, network *net, float *b, float *ko, int player, float cpuct)
 
void engine_go (char *filename, char *weightfile, int mcts_iters, float secs, float temp, float cpuct, int anon, int resign)
 
void test_go (char *cfg, char *weights, int multi)
 
float score_game (float *board)
 
void self_go (char *filename, char *weightfile, char *f2, char *w2, int multi)
 
void run_go (int argc, char **argv)
 

Variables

int inverted = 1
 
int noi = 1
 

Typedef Documentation

◆ mcts_tree

typedef struct mcts_tree mcts_tree

Function Documentation

◆ board_to_string()

void board_to_string ( char *  s,
float *  board 
)

Definition at line 71 of file go.c.

◆ check_ko()

int check_ko ( float *  x,
float *  ko 
)

Definition at line 637 of file go.c.

◆ compare_board()

int compare_board ( float *  a,
float *  b 
)

Definition at line 356 of file go.c.

◆ copy_board()

float* copy_board ( float *  board)

Definition at line 454 of file go.c.

◆ engine_go()

void engine_go ( char *  filename,
char *  weightfile,
int  mcts_iters,
float  secs,
float  temp,
float  cpuct,
int  anon,
int  resign 
)

Definition at line 813 of file go.c.

◆ expand()

mcts_tree* expand ( float *  next,
float *  ko,
network net 
)

Definition at line 424 of file go.c.

◆ fgetgo()

char* fgetgo ( FILE *  fp)

Definition at line 18 of file go.c.

◆ flip_board()

void flip_board ( float *  board)

Definition at line 286 of file go.c.

◆ free_mcts()

void free_mcts ( mcts_tree root)

Definition at line 376 of file go.c.

◆ legal_go()

int legal_go ( float *  b,
float *  ko,
int  p,
int  r,
int  c 
)

Definition at line 647 of file go.c.

◆ load_go_moves()

moves load_go_moves ( char *  filename)

Definition at line 31 of file go.c.

◆ move_go()

void move_go ( float *  b,
int  p,
int  r,
int  c 
)

Definition at line 344 of file go.c.

◆ move_mcts()

mcts_tree* move_mcts ( mcts_tree tree,
int  index 
)

Definition at line 528 of file go.c.

◆ network_predict_rotations()

float* network_predict_rotations ( network net,
float *  next 
)

Definition at line 393 of file go.c.

◆ pick_move()

move pick_move ( mcts_tree tree,
float  temp,
int  player 
)

Definition at line 549 of file go.c.

◆ ponder()

mcts_tree* ponder ( mcts_tree tree,
network net,
float *  b,
float *  ko,
int  player,
float  cpuct 
)

Definition at line 800 of file go.c.

◆ predict_move2()

float predict_move2 ( network net,
float *  board,
float *  move,
int  multi 
)

Definition at line 297 of file go.c.

◆ print_board()

void print_board ( FILE *  stream,
float *  board,
int  player,
int *  indexes 
)

Definition at line 247 of file go.c.

◆ print_game()

int print_game ( float *  board,
FILE *  fp 
)

Definition at line 766 of file go.c.

◆ random_go_moves()

data random_go_moves ( moves  m,
int  n 
)

Definition at line 95 of file go.c.

◆ run_go()

void run_go ( int  argc,
char **  argv 
)

Definition at line 1320 of file go.c.

◆ run_mcts()

mcts_tree* run_mcts ( mcts_tree tree,
network net,
float *  board,
float *  ko,
int  player,
int  n,
float  cpuct,
float  secs 
)

Definition at line 510 of file go.c.

◆ score_game()

float score_game ( float *  board)

Definition at line 1187 of file go.c.

◆ select_mcts()

float select_mcts ( mcts_tree root,
network net,
float *  prev,
float  cpuct 
)

Definition at line 461 of file go.c.

◆ self_go()

void self_go ( char *  filename,
char *  weightfile,
char *  f2,
char *  w2,
int  multi 
)

Definition at line 1213 of file go.c.

◆ stdin_ready()

int stdin_ready ( )

Definition at line 784 of file go.c.

◆ string_to_board()

void string_to_board ( char *  s,
float *  board 
)

Definition at line 53 of file go.c.

◆ suicide_go()

int suicide_go ( float *  b,
int  p,
int  r,
int  c 
)

Definition at line 625 of file go.c.

◆ test_go()

void test_go ( char *  cfg,
char *  weights,
int  multi 
)

Definition at line 1098 of file go.c.

◆ train_go()

void train_go ( char *  cfgfile,
char *  weightfile,
char *  filename,
int *  gpus,
int  ngpus,
int  clear 
)

Definition at line 134 of file go.c.

◆ valid_go()

void valid_go ( char *  cfgfile,
char *  weightfile,
int  multi,
char *  filename 
)

Definition at line 733 of file go.c.

Variable Documentation

◆ inverted

int inverted = 1

Definition at line 7 of file go.c.

◆ noi

int noi = 1

Definition at line 8 of file go.c.