
# **PPO** Agent playing **LunarLander-v2**
This is a trained model of a **PPO** agent playing **LunarLander-v2**, trained for 1e6 time steps, obtaining:
**mean_reward** = 241.85 +/- 48.02

using the [stable-baselines3 library](https://github.com/DLR-RM/stable-baselines3).

## Usage (with Stable-baselines3)


```python
import gym                     

from stable_baselines3 import PPO                                # Modelo que vamos a usar
from stable_baselines3.common.evaluation import evaluate_policy  # Evaluación de los resultados del modelo entrenado
from stable_baselines3.common.env_util import make_vec_env

# Creo el env
env = gym.make('LunarLander-v2')

# Selecciono el modelo, en este caso el PPO, y lo ponemos a entrenar
model = PPO('MlpPolicy',env,verbose=1).learn(total_timesteps=1000000,progress_bar=True)

# Lo guardamos
model.save('Lunar_Lander')

# Creamos un nuevo env en el que probamos el modelo (valdría el mismo pero reseteado)
eval_env = gym.make('LunarLander-v2')

# Evaluamos el modelo
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}")

```
{"library_name": "stable-baselines3", "tags": ["LunarLander-v2", "deep-reinforcement-learning", "reinforcement-learning", "stable-baselines3"], "model-index": [{"name": "PPO", "results": [{"task": {"type": "reinforcement-learning", "name": "reinforcement-learning"}, "dataset": {"name": "LunarLander-v2", "type": "LunarLander-v2"}, "metrics": [{"type": "mean_reward", "value": "241.85 +/- 48.02", "name": "mean_reward", "verified": false}]}]}]}
stable-baselines3 LunarLander-v2 deep-reinforcement-learning reinforcement-learning model-index region:us
TAGS
#stable-baselines3 #LunarLander-v2 #deep-reinforcement-learning #reinforcement-learning #model-index #region-us 


# PPO Agent playing LunarLander-v2
This is a trained model of a PPO agent playing LunarLander-v2, trained for 1e6 time steps, obtaining:
mean_reward = 241.85 +/- 48.02

using the stable-baselines3 library.

## Usage (with Stable-baselines3)



# PPO Agent playing LunarLander-v2
This is a trained model of a PPO agent playing LunarLander-v2, trained for 1e6 time steps, obtaining:
mean_reward = 241.85 +/- 48.02

using the stable-baselines3 library. ## Usage (with Stable-baselines3)
TAGS
#stable-baselines3 #LunarLander-v2 #deep-reinforcement-learning #reinforcement-learning #model-index #region-us 
 # PPO Agent playing LunarLander-v2
This is a trained model of a PPO agent playing LunarLander-v2, trained for 1e6 time steps, obtaining:
mean_reward = 241.85 +/- 48.02

using the stable-baselines3 library. ## Usage (with Stable-baselines3)
TAGS
#stable-baselines3 #LunarLander-v2 #deep-reinforcement-learning #reinforcement-learning #model-index #region-us 
# PPO Agent playing LunarLander-v2
This is a trained model of a PPO agent playing LunarLander-v2, trained for 1e6 time steps, obtaining:
mean_reward = 241.85 +/- 48.02

using the stable-baselines3 library.## Usage (with Stable-baselines3)