Async agents for Stable Baselines 3
Project description
Async Gym Agents
Wrapper environments and agent injectors to allow for drop-in async training.
import gymnasium as gym
from functools import partial
from stable_baselines3 import TD3
from 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 (Also supports VecEnvs)
env = IndexableMultiEnv([partial(gym.make, "Pendulum-v1") for i in range(8)])
# Create the model, injected with async capabilities
model = get_injected_agent(TD3)("MlpPolicy", env, use_mp=False)
# Train the model
model.learn(total_timesteps=10)
# Shut down workers
model.shutdown()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async_gym_agents-0.2.2.tar.gz
(12.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async_gym_agents-0.2.2.tar.gz.
File metadata
- Download URL: async_gym_agents-0.2.2.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4984ee6d98adb947200d3dcca76d3d704a73145eab4435b26d545e599a7466b
|
|
| MD5 |
903c02637ecf172b4604c013e000bb50
|
|
| BLAKE2b-256 |
22030bf294e330af1d1628707f0d573e3c2e9e77771d7cda60b980a5760a160d
|
File details
Details for the file async_gym_agents-0.2.2-py3-none-any.whl.
File metadata
- Download URL: async_gym_agents-0.2.2-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be616ce75c72b7da89681a8008a27d5cd24ff5189aff3ad50861a7aaf7de1965
|
|
| MD5 |
6a5b96bc02f10fcfe830c98afe22cc27
|
|
| BLAKE2b-256 |
af9d4b056df2c1c6156d92eff54168db6b0fac32cab19f01845a054a7cc366ed
|