def train_stable_baselines(args):
	"""
		Trains with PPO2 on specified environment.

		Parameters:
			args - the arguments defined in main.

		Return:
			None
	"""
	from stable_baselines3 import PPO

	# Store hyperparameters and total timesteps to run by environment
	hyperparameters = {}
	total_timesteps = 0
	if args.env == 'Pendulum-v1':
		hyperparameters = {'n_steps': 2048, 'batch_size': 32, 'gae_lambda': 0.95, 'gamma': 0.99, 'n_epochs': 10,
							'ent_coef': 0.0, 'learning_rate': 3e-4, 'clip_range': 0.2, 'verbose': 1, 'seed': args.seed}
		total_timesteps = 1005000
	elif args.env == 'BipedalWalker-v3':
		hyperparameters = {'n_steps': 2048, 'batch_size': 32, 'gae_lambda': 0.95, 'gamma': 0.99, 'n_epochs': 10,
							'ent_coef': 0.001, 'learning_rate': 2.5e-4, 'clip_range': 0.2, 'verbose': 1, 'seed': args.seed}
		total_timesteps = 1405000
	elif args.env == 'LunarLanderContinuous-v2':
		hyperparameters = {'n_steps': 1024, 'batch_size': 32, 'gae_lambda': 0.98, 'gamma': 0.999, 'n_epochs': 4,
							'ent_coef': 0.01, 'clip_range': 0.2, 'verbose': 1, 'seed': args.seed}
		total_timesteps = 1005000
	elif args.env == 'MountainCarContinuous-v0':
		hyperparameters = {'n_steps': 256, 'batch_size': 8, 'gae_lambda': 0.94, 'gamma': 0.99, 'n_epochs': 4,
							'ent_coef': 0.0, 'clip_range': 0.2, 'verbose': 1, 'seed': args.seed}
		total_timesteps = 405000

	# Create log dir
	log_dir = "/tmp/gym/"
	os.makedirs(log_dir, exist_ok=True)

	# Make the environment and model, and train
	env = gym.make(args.env)
	model = PPO("MlpPolicy", env, **hyperparameters)
	model.learn(total_timesteps)
Trains with PPO2 on specified environment.

Parameters:
args - the arguments defined in main.

Return:
None
part4/run.py