Run this model with HF Jobs
Run smatt92/ppo-LunarLander-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/smatt92/ppo-LunarLander-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/smatt92/ppo-LunarLander-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use smatt92/ppo-LunarLander-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use smatt92/ppo-LunarLander-v2 with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="smatt92/ppo-LunarLander-v2", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
- PPO Agent playing LunarLander-v2
- Create environment
- Instantiate the agent
- Train the agent
- TODO: Define a PPO MlpPolicy architecture
- We use MultiLayerPerceptron (MLPPolicy) because the input is a vector,
- if we had frames as input we would use CnnPolicy
- TODO: Train it for 1,000,000 timesteps
- TODO: Specify file name for model and save the model to file
- TODO: Evaluate the agent
- Create a new environment for evaluation
- Evaluate the model with 10 evaluation episodes and deterministic=True
- Print the results
PPO Agent playing LunarLander-v2
This is a trained model of a PPO agent playing LunarLander-v2 using the stable-baselines3 library.
Usage (with Stable-baselines3)
TODO: Add your code
Create environment
env = gym.make('LunarLander-v2')
Instantiate the agent
model = PPO('MlpPolicy', env, verbose=1)
Train the agent
model.learn(total_timesteps=int(2e5))
TODO: Define a PPO MlpPolicy architecture
We use MultiLayerPerceptron (MLPPolicy) because the input is a vector,
if we had frames as input we would use CnnPolicy
model = PPO( policy = 'MlpPolicy', env = env, n_steps = 4096, batch_size = 128, n_epochs = 8, gamma = 0.999, gae_lambda = 0.98, ent_coef = 0.01, verbose=1)
TODO: Train it for 1,000,000 timesteps
model.learn(total_timesteps=2000000)
TODO: Specify file name for model and save the model to file
model_name = "ppo-LunarLander-v2" model.save(model_name)
TODO: Evaluate the agent
Create a new environment for evaluation
eval_env = Monitor(gym.make("LunarLander-v2"))
Evaluate the model with 10 evaluation episodes and deterministic=True
mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10, deterministic=True)
Print the results
print(f"mean_reward={mean_reward:.2f} +/- {std_reward}")
from stable_baselines3 import ...
from huggingface_sb3 import load_from_hub
...
- Downloads last month
- 2
Evaluation results
- mean_reward on LunarLander-v2self-reported271.39 +/- 12.49