Skip to main content

Crate r2l_core

Crate r2l_core 

Source
Expand description

Core traits and data types shared by the r2l workspace.

r2l-core is the contracts crate. It defines the small set of interfaces that environments, samplers, policies, agents, learners, and tensor backends agree on. Backend-specific implementations live in crates such as r2l-burn and r2l-candle; concrete algorithms and builders live outside this crate as well.

Most downstream code should start with the prelude:

use r2l_core::prelude::*;

The main extension points are:

Modules§

buffers
Rollout transition and trajectory storage.
env
Environment traits and space descriptions.
error
Error types
models
Actor, policy, value-function, and learner traits.
on_policy
Shared interfaces for on-policy training loops. Shared contracts for on-policy algorithms.
prelude
Common imports for implementing environments, policies, agents, samplers, and learners.
rng
Reproducible random-number utilities.
running_mean
Online mean and variance estimators.
tensor
Backend-neutral tensor interfaces and adapters.

Macros§

break_on_hook_result
Breaks out of the surrounding loop when a hook requests HookResult::Break.
return_on_hook_result
Returns Ok(()) from the surrounding function when a hook requests HookResult::Break.

Structs§

ActorWrapper

Enums§

HookResult
Control-flow result returned by training hooks.