Object-oriented RL agents based on torchrl, together with examples on benchmark environments.
Project description
TorchRL Agents
TorchRL Agents is a Python package that provides object-oriented reinforcement learning (RL) agents built on top of PyTorch and TorchRL.
Object-Oriented Design
At the core of this package is the Agent abstract base class, which defines a structured interface for RL agents. The Agent class provides a blueprint that other classes can subclass to implement specific RL algorithms. This design ensures consistency and reusability across different agents.
Key Features of the Agent Class:
- Abstract Methods: Enforces the implementation of essential functionalities, such as processing batches and defining policies.
- Serialization: Supports saving and loading agent configurations and weights, enabling easy training and deployment.
- Modularity: Allows for easy extension and customization by subclassing.
By subclassing the Agent class, you can implement various RL algorithms while adhering to a consistent structure.
Examples
The examples folder contains practical demonstrations of how to use the agents implemented in this package. These examples showcase:
- Training RL agents on benchmark environments such as CartPole and Pendulum.
- Using the modular components of the
Agentclass to customize behavior. - Saving and loading trained agents for evaluation or deployment.
Getting Started
-
Install uv
-
Clone the repository and create a virtual environment:
git clone https://github.com/valterschutz/torchrl-examples.git uv sync
-
Explore the
examplesfolder to see how to train and evaluate RL agents. The scripts can be run without any arguments.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
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 torchrl_agents-0.2.2.tar.gz.
File metadata
- Download URL: torchrl_agents-0.2.2.tar.gz
- Upload date:
- Size: 99.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ebf261a3e5d32688ac15e874aae507b46163365bb64d99f7b93a45e028b9db
|
|
| MD5 |
cda4b9cf57ed6c68b3c82c4bb69294b7
|
|
| BLAKE2b-256 |
ff5f8de68c7ec71d7aa528ad2a4230c41ce78ae1b5ac856102831d51f26de108
|
File details
Details for the file torchrl_agents-0.2.2-py3-none-any.whl.
File metadata
- Download URL: torchrl_agents-0.2.2-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75be85a5519cd7487f1464979ddd31dc88903802435433791a4069b040ee9d8
|
|
| MD5 |
bf0f0e9607fcf4a1f347814cab6cc422
|
|
| BLAKE2b-256 |
eb8d4a560084d3c14dbf14b20f7363f4f336bfbb0b41f28c62427f155dd3b9e6
|