Crate relearn

Source
Expand description

A reinforcement learning library.

This library defines a set of environments and learning agents and simulates their interaction.

Environments implement the Environment trait, which has associated observation, action, and state types. Agents implement Agent and provide Actors that generate actions in response to environment observations. Agents can learn via the BatchUpdate trait.

Agent traits are generic over the observation (O) and action (A) types of the environment. The EnvStructure trait provides more details about possible values for these types via the Space trait. A Space can be thought of as a runtime-defined type, describing a set of possible values while methods are provided by other traits in spaces.

Environment-actor simulation is performed by Steps and the resulting Step are accessible via an Iterator interface. Training is performed by train_serial and train_parallel.

This library uses PyTorch via tch.

Re-exports§

pub use agents::Actor;
pub use agents::Agent;
pub use agents::BatchUpdate;
pub use agents::BuildAgent;
pub use envs::BuildEnv;
pub use envs::EnvStructure;
pub use envs::Environment;
pub use simulation::train_parallel;
pub use simulation::train_serial;
pub use simulation::Simulation;
pub use simulation::Step;
pub use simulation::Steps;
pub use simulation::StepsIter;

Modules§

agents
Reinforcement learning agents
envs
Reinforcement learning environments
feedback
Agent-environment feedback
logging
Logging statistics from simulation runs
simulation
Simulating agent-environment interaction
spaces
Spaces: runtime-defined types
torch
Torch components
utils
General-purpose utilities

Type Aliases§

Prng
Pseudo-random number generator type used by agents and environments in this crate.