2021-09-07 16:38:34 +08:00
|
|
|
import argparse
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description='DouZero: PyTorch DouDizhu AI')
|
|
|
|
|
|
|
|
# General Settings
|
|
|
|
parser.add_argument('--xpid', default='douzero',
|
|
|
|
help='Experiment id (default: douzero)')
|
2021-12-05 13:01:29 +08:00
|
|
|
parser.add_argument('--save_interval', default=30, type=int,
|
2021-09-07 16:38:34 +08:00
|
|
|
help='Time interval (in minutes) at which to save the model')
|
|
|
|
parser.add_argument('--objective', default='adp', type=str, choices=['adp', 'wp', 'logadp'],
|
|
|
|
help='Use ADP or WP as reward (default: ADP)')
|
|
|
|
|
|
|
|
# Training settings
|
2021-12-19 20:00:42 +08:00
|
|
|
parser.add_argument('--onnx_sync_interval', default=120, type=int,
|
2021-12-19 19:09:27 +08:00
|
|
|
help='Time interval (in seconds) at which to sync the onnx model')
|
2021-09-07 16:38:34 +08:00
|
|
|
parser.add_argument('--gpu_devices', default='0', type=str,
|
|
|
|
help='Which GPUs to be used for training')
|
2022-01-01 23:21:14 +08:00
|
|
|
parser.add_argument('--infer_devices', default='0', type=str,
|
|
|
|
help='Which device to be used for infer')
|
2022-01-04 11:12:36 +08:00
|
|
|
parser.add_argument('--num_infer', default=2, type=int,
|
2022-01-01 23:21:14 +08:00
|
|
|
help='The number of process used for infer')
|
2021-09-07 16:38:34 +08:00
|
|
|
parser.add_argument('--num_actor_devices', default=1, type=int,
|
|
|
|
help='The number of devices used for simulation')
|
2022-01-04 11:12:36 +08:00
|
|
|
parser.add_argument('--num_actors', default=3, type=int,
|
2021-09-07 16:38:34 +08:00
|
|
|
help='The number of actors for each simulation device')
|
2022-01-04 11:12:36 +08:00
|
|
|
parser.add_argument('--num_actors_thread', default=4, type=int,
|
2021-12-11 20:07:41 +08:00
|
|
|
help='The number of actors for each simulation device')
|
2021-09-07 16:38:34 +08:00
|
|
|
parser.add_argument('--training_device', default='0', type=str,
|
|
|
|
help='The index of the GPU used for training models. `cpu` means using cpu')
|
|
|
|
parser.add_argument('--load_model', action='store_true',
|
|
|
|
help='Load an existing model')
|
2021-12-10 16:12:50 +08:00
|
|
|
parser.add_argument('--old_model', action='store_true',
|
|
|
|
help='Use vanilla model')
|
2022-01-04 18:15:35 +08:00
|
|
|
parser.add_argument('--unified_model', action='store_true',
|
|
|
|
help='Use unified model')
|
2021-12-22 21:19:10 +08:00
|
|
|
parser.add_argument('--lite_model', action='store_true',
|
|
|
|
help='Use lite card model')
|
2021-12-11 22:10:40 +08:00
|
|
|
parser.add_argument('--lagacy_model', action='store_true',
|
|
|
|
help='Use lagacy bomb model')
|
2021-09-07 16:38:34 +08:00
|
|
|
parser.add_argument('--disable_checkpoint', action='store_true',
|
|
|
|
help='Disable saving checkpoint')
|
|
|
|
parser.add_argument('--savedir', default='douzero_checkpoints',
|
|
|
|
help='Root dir where experiment data will be saved')
|
2021-12-15 12:26:47 +08:00
|
|
|
parser.add_argument('--enable_onnx', action='store_true',
|
|
|
|
help='Use onnx model for train')
|
2021-12-21 12:49:53 +08:00
|
|
|
parser.add_argument('--onnx_model_path', default='douzero_checkpoints',
|
|
|
|
help='Root dir where onnx temp model will be saved')
|
2021-12-25 19:06:34 +08:00
|
|
|
parser.add_argument('--enable_upload', action='store_true',
|
|
|
|
help='Should the cpkt model will be upload to server')
|
|
|
|
parser.add_argument('--upload_url', default='https://dou.zaneyork.cn:8443/model/upload',
|
|
|
|
help='The cpkt model will be upload to')
|
2021-09-07 16:38:34 +08:00
|
|
|
|
|
|
|
# Hyperparameters
|
|
|
|
parser.add_argument('--total_frames', default=100000000000, type=int,
|
|
|
|
help='Total environment frames to train for')
|
|
|
|
parser.add_argument('--exp_epsilon', default=0.01, type=float,
|
|
|
|
help='The probability for exploration')
|
|
|
|
parser.add_argument('--batch_size', default=16, type=int,
|
|
|
|
help='Learner batch size')
|
|
|
|
parser.add_argument('--unroll_length', default=100, type=int,
|
|
|
|
help='The unroll length (time dimension)')
|
|
|
|
parser.add_argument('--num_buffers', default=50, type=int,
|
|
|
|
help='Number of shared-memory buffers')
|
|
|
|
parser.add_argument('--num_threads', default=1, type=int,
|
|
|
|
help='Number learner threads')
|
|
|
|
parser.add_argument('--max_grad_norm', default=40., type=float,
|
|
|
|
help='Max norm of gradients')
|
|
|
|
|
|
|
|
# Optimizer settings
|
|
|
|
parser.add_argument('--learning_rate', default=0.0001, type=float,
|
|
|
|
help='Learning rate')
|
|
|
|
parser.add_argument('--alpha', default=0.99, type=float,
|
|
|
|
help='RMSProp smoothing constant')
|
|
|
|
parser.add_argument('--momentum', default=0, type=float,
|
|
|
|
help='RMSProp momentum')
|
|
|
|
parser.add_argument('--epsilon', default=1e-8, type=float,
|
|
|
|
help='RMSProp epsilon')
|