Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luke100000/async-gym-agents
https://github.com/luke100000/async-gym-agents
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/luke100000/async-gym-agents
- Owner: Luke100000
- Created: 2024-06-27T14:22:27.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-14T08:11:25.000Z (3 months ago)
- Last Synced: 2024-08-14T09:33:25.198Z (3 months ago)
- Language: Python
- Size: 98.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Async Gym Agents
Wrapper environments and agent injectors to allow for drop-in async training.
```py
import gymnasium as gym
from stable_baselines3 import TD3from async_gym_agents.agents.async_agent import get_injected_agent
from async_gym_agents.envs.multi_env import IndexableMultiEnv# Create env with 8 parallel envs
env = IndexableMultiEnv([lambda: gym.make("Pendulum-v1") for i in range(8)])# Create the model, injected with async capabilities
model = get_injected_agent(TD3)("MlpPolicy", env)# Train the model
model.learn(total_timesteps=10)# Shut down workers
model.shutdown()
```