in go/game.py [0:0]
def initialize(self):
args = self.args
co = go.ContextOptions()
self.context_args.initialize(co)
co.print()
opt = go.GameOptions()
opt.seed = 0
opt.list_filename = args.list_file
opt.mode = args.mode
opt.use_mcts = args.use_mcts
opt.verbose = args.verbose
opt.data_aug = args.data_aug
opt.ratio_pre_moves = args.ratio_pre_moves
opt.start_ratio_pre_moves = args.start_ratio_pre_moves
opt.move_cutoff = args.move_cutoff
opt.num_games_per_thread = args.num_games_per_thread
GC = go.GameContext(co, opt)
print("Version: ", GC.Version())
params = GC.GetParams()
print("Num Actions: ", params["num_action"])
desc = {}
if args.mode == "online":
desc["human_actor"] = dict(
batchsize=args.batchsize,
input=dict(T=1, keys=set(["s"])),
reply=dict(T=1, keys=set(["pi", "a"])),
name="human_actor",
)
# Used for MCTS/Direct play.
desc["actor"] = dict(
batchsize=args.batchsize,
input=dict(T=1, keys=set(["s"])),
reply=dict(T=1, keys=set(["pi", "V", "a"])),
name="actor",
)
elif args.mode == "selfplay":
# Used for MCTS/Direct play.
desc["actor"] = dict(
batchsize=args.batchsize,
input=dict(T=1, keys=set(["s"])),
reply=dict(T=1, keys=set(["pi", "V"])),
name="actor",
timeout_usec = 10,
)
else:
desc["train"] = dict(
batchsize=args.batchsize,
input=dict(T=args.T, keys=set(["s", "offline_a"])),
reply=None
)
self.more_labels.add_labels(desc)
params.update(dict(
num_group = 1 if args.actor_only else 2,
T = args.T,
))
return GCWrapper(GC, co, desc, gpu=args.gpu, use_numpy=False, params=params)