from stable_baselines3 import PPO
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.evaluation import evaluate_policy
from huggingface_sb3 import load_from_hub
# Download the model checkpoint
model_checkpoint = load_from_hub("ckandemir/ppo-LunarLander-v2", "ppo-LunarLander-v2.zip")
# Create a vectorized environment
env = make_vec_env("LunarLander-v2", n_envs=1)
# Load the model
model = PPO.load(model_checkpoint, env=env)
# Evaluateprint("Evaluating model")
mean_reward, std_reward = evaluate_policy(
model,
env,
n_eval_episodes=10,
deterministic=True,
)
print(f"Mean reward = {mean_reward:.2f} +/- {std_reward}")
# Start a new episode
obs = env.reset()
try:
whileTrue:
action, state = model.predict(obs, deterministic=True)
obs, reward, done, info = env.step(action)
env.render()
except KeyboardInterrupt:
pass
Runs of ckandemir ppo-LunarLander-v2 on huggingface.co
3
Total runs
0
24-hour runs
-1
3-day runs
-1
7-day runs
-4
30-day runs
More Information About ppo-LunarLander-v2 huggingface.co Model
ppo-LunarLander-v2 huggingface.co
ppo-LunarLander-v2 huggingface.co is an AI model on huggingface.co that provides ppo-LunarLander-v2's model effect (), which can be used instantly with this ckandemir ppo-LunarLander-v2 model. huggingface.co supports a free trial of the ppo-LunarLander-v2 model, and also provides paid use of the ppo-LunarLander-v2. Support call ppo-LunarLander-v2 model through api, including Node.js, Python, http.
ppo-LunarLander-v2 huggingface.co is an online trial and call api platform, which integrates ppo-LunarLander-v2's modeling effects, including api services, and provides a free online trial of ppo-LunarLander-v2, you can try ppo-LunarLander-v2 online for free by clicking the link below.
ckandemir ppo-LunarLander-v2 online free url in huggingface.co:
ppo-LunarLander-v2 is an open source model from GitHub that offers a free installation service, and any user can find ppo-LunarLander-v2 on GitHub to install. At the same time, huggingface.co provides the effect of ppo-LunarLander-v2 install, users can directly use ppo-LunarLander-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.