Views
No views yet
1from skrl.utils.huggingface import download_model_from_huggingface
2
3# assuming that there is an agent named `agent`
4path = download_model_from_huggingface("skrl/IsaacGymEnvs-Humanoid-PPO", filename="agent.pt")
5agent.load(path)1from skrl.utils.huggingface import download_model_from_huggingface
2
3# assuming that there is an agent named `agent`
4path = download_model_from_huggingface("skrl/IsaacGymEnvs-Humanoid-PPO", filename="agent.pickle")
5agent.load(path)1# https://skrl.readthedocs.io/en/latest/api/agents/ppo.html#configuration-and-hyperparameters
2cfg = PPO_DEFAULT_CONFIG.copy()
3cfg["rollouts"] = 32 # memory_size
4cfg["learning_epochs"] = 5
5cfg["mini_batches"] = 4 # 32 * 4096 / 32768
6cfg["discount_factor"] = 0.99
7cfg["lambda"] = 0.95
8cfg["learning_rate"] = 5e-4
9cfg["learning_rate_scheduler"] = KLAdaptiveRL
10cfg["learning_rate_scheduler_kwargs"] = {"kl_threshold": 0.008}
11cfg["random_timesteps"] = 0
12cfg["learning_starts"] = 0
13cfg["grad_norm_clip"] = 1.0
14cfg["ratio_clip"] = 0.2
15cfg["value_clip"] = 0.2
16cfg["clip_predicted_values"] = True
17cfg["entropy_loss_scale"] = 0.0
18cfg["value_loss_scale"] = 2.0
19cfg["kl_threshold"] = 0
20cfg["rewards_shaper"] = lambda rewards, timestep, timesteps: rewards * 0.01
21cfg["state_preprocessor"] = RunningStandardScaler
22cfg["state_preprocessor_kwargs"] = {"size": env.observation_space, "device": device}
23cfg["value_preprocessor"] = RunningStandardScaler
24cfg["value_preprocessor_kwargs"] = {"size": 1, "device": device}