固定随机种子比较强化学习算法
random.seed(args.seed) np.random.seed(args.seed) torch.cuda.manual_seed(args.seed) torch.manual_seed(args.seed) torch.backends.cudnn.deterministic = True env = gym.make(env_name).unwrapped env.seed(args.seed)
上海交通大学CS博士生
random.seed(args.seed) np.random.seed(args.seed) torch.cuda.manual_seed(args.seed) torch.manual_seed(args.seed) torch.backends.cudnn.deterministic = True env = gym.make(env_name).unwrapped env.seed(args.seed)