Struct OffPolicyStrategy
pub struct OffPolicyStrategy<RLC>where
RLC: RLComponentsTypes,{ /* private fields */ }Expand description
Off-policy reinforcement learning strategy with multi-env experience collection and double-batching.
Implementations§
§impl<RLC> OffPolicyStrategy<RLC>where
RLC: RLComponentsTypes,
impl<RLC> OffPolicyStrategy<RLC>where
RLC: RLComponentsTypes,
pub fn new(config: OffPolicyConfig) -> OffPolicyStrategy<RLC>
pub fn new(config: OffPolicyConfig) -> OffPolicyStrategy<RLC>
Create a new off-policy base strategy.
Trait Implementations§
§impl<RLC> RLStrategy<RLC> for OffPolicyStrategy<RLC>where
RLC: RLComponentsTypes,
<RLC as RLComponentsTypes>::PolicyObs: SliceAccess<<RLC as RLComponentsTypes>::Backend>,
<RLC as RLComponentsTypes>::PolicyAction: SliceAccess<<RLC as RLComponentsTypes>::Backend>,
impl<RLC> RLStrategy<RLC> for OffPolicyStrategy<RLC>where
RLC: RLComponentsTypes,
<RLC as RLComponentsTypes>::PolicyObs: SliceAccess<<RLC as RLComponentsTypes>::Backend>,
<RLC as RLComponentsTypes>::PolicyAction: SliceAccess<<RLC as RLComponentsTypes>::Backend>,
§fn train_loop(
&self,
training_components: RLComponents<RLC>,
learner_agent: &mut <RLC as RLComponentsTypes>::LearningAgent,
starting_epoch: usize,
env_init: <RLC as RLComponentsTypes>::EnvInit,
) -> (<RLC as RLComponentsTypes>::Policy, AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>)
fn train_loop( &self, training_components: RLComponents<RLC>, learner_agent: &mut <RLC as RLComponentsTypes>::LearningAgent, starting_epoch: usize, env_init: <RLC as RLComponentsTypes>::EnvInit, ) -> (<RLC as RLComponentsTypes>::Policy, AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>)
Training loop for this strategy
§fn train(
&self,
learner_agent: <RLC as RLComponentsTypes>::LearningAgent,
training_components: RLComponents<RLC>,
env_init: <RLC as RLComponentsTypes>::EnvInit,
) -> RLResult<<RLC as RLComponentsTypes>::Policy>
fn train( &self, learner_agent: <RLC as RLComponentsTypes>::LearningAgent, training_components: RLComponents<RLC>, env_init: <RLC as RLComponentsTypes>::EnvInit, ) -> RLResult<<RLC as RLComponentsTypes>::Policy>
Train the learner agent with this strategy.
Auto Trait Implementations§
impl<RLC> Freeze for OffPolicyStrategy<RLC>
impl<RLC> RefUnwindSafe for OffPolicyStrategy<RLC>where
RLC: RefUnwindSafe,
impl<RLC> Send for OffPolicyStrategy<RLC>where
RLC: Send,
impl<RLC> Sync for OffPolicyStrategy<RLC>where
RLC: Sync,
impl<RLC> Unpin for OffPolicyStrategy<RLC>where
RLC: Unpin,
impl<RLC> UnwindSafe for OffPolicyStrategy<RLC>where
RLC: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more