
# RL Agents Playing Parking-v0

Here are trained models of RL agents playing Parking-v0.

## Get Started

1. Install the **parking-env** package.

```bash
git clone https://github.com/KexianShen/parking-env.git
cd parking-env
pip install -e .
```

2. Run the provided example.ipynb notebook or execute the following code:

```python
import gymnasium as gym
import numpy as np
import torch

from parking_ppo import Agent

env = gym.make(
    id="Parking-v0", render_mode="human", observation_type="rgb", action_type="discrete"
)
env = gym.wrappers.GrayScaleObservation(env)
env = gym.wrappers.FrameStack(env, 4)

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
agent = torch.load("ppo.pth").eval().to(device)

obs, _ = env.reset(seed=42)
terminated = False
truncated = False

while not terminated and not truncated:
    obs = torch.Tensor(np.array(obs)).to(device).unsqueeze(0)
    with torch.no_grad():
        action, _, _, _ = agent.get_action_and_value(obs)
        action = action.cpu().numpy().item()
    obs, reward, terminated, truncated, info = env.step(action)

env.close()
```
{"license": "mit", "library_name": "parking-env", "tags": ["deep-reinforcement-learning", "reinforcement-learning", "custom-implementation"]}
parking-env deep-reinforcement-learning reinforcement-learning custom-implementation license:mit region:us
TAGS
#parking-env #deep-reinforcement-learning #reinforcement-learning #custom-implementation #license-mit #region-us 


# RL Agents Playing Parking-v0

Here are trained models of RL agents playing Parking-v0.

## Get Started

1. Install the parking-env package.



2. Run the provided URL notebook or execute the following code:


# RL Agents Playing Parking-v0

Here are trained models of RL agents playing Parking-v0. ## Get Started

1. Install the parking-env package.



2. Run the provided URL notebook or execute the following code:
TAGS
#parking-env #deep-reinforcement-learning #reinforcement-learning #custom-implementation #license-mit #region-us 
 # RL Agents Playing Parking-v0

Here are trained models of RL agents playing Parking-v0. ## Get Started

1. Install the parking-env package.



2. Run the provided URL notebook or execute the following code: