Struct RLCheckpointer
pub struct RLCheckpointer<RLC>where
RLC: RLComponentsTypes,{ /* private fields */ }Expand description
Used to create, delete, or load checkpoints of the training process.
Implementations§
§impl<RLC> RLCheckpointer<RLC>where
RLC: RLComponentsTypes,
impl<RLC> RLCheckpointer<RLC>where
RLC: RLComponentsTypes,
pub fn new(
policy: AsyncCheckpointer<<<<RLC as RLComponentsTypes>::Policy as Policy<<RLC as RLComponentsTypes>::Backend>>::PolicyState as PolicyState<<RLC as RLComponentsTypes>::Backend>>::Record, <RLC as RLComponentsTypes>::Backend>,
learning_agent: AsyncCheckpointer<<<RLC as RLComponentsTypes>::LearningAgent as PolicyLearner<<RLC as RLComponentsTypes>::Backend>>::Record, <RLC as RLComponentsTypes>::Backend>,
strategy: Box<dyn CheckpointingStrategy>,
) -> RLCheckpointer<RLC>
pub fn new( policy: AsyncCheckpointer<<<<RLC as RLComponentsTypes>::Policy as Policy<<RLC as RLComponentsTypes>::Backend>>::PolicyState as PolicyState<<RLC as RLComponentsTypes>::Backend>>::Record, <RLC as RLComponentsTypes>::Backend>, learning_agent: AsyncCheckpointer<<<RLC as RLComponentsTypes>::LearningAgent as PolicyLearner<<RLC as RLComponentsTypes>::Backend>>::Record, <RLC as RLComponentsTypes>::Backend>, strategy: Box<dyn CheckpointingStrategy>, ) -> RLCheckpointer<RLC>
Constructs a new RLCheckpointer.
§impl<RLC> RLCheckpointer<RLC>where
RLC: RLComponentsTypes,
impl<RLC> RLCheckpointer<RLC>where
RLC: RLComponentsTypes,
pub fn checkpoint(
&mut self,
policy: &<RLC as RLComponentsTypes>::PolicyState,
learning_agent: &<RLC as RLComponentsTypes>::LearningAgent,
epoch: usize,
store: &EventStoreClient,
)
pub fn checkpoint( &mut self, policy: &<RLC as RLComponentsTypes>::PolicyState, learning_agent: &<RLC as RLComponentsTypes>::LearningAgent, epoch: usize, store: &EventStoreClient, )
Create checkpoint for the training process.
pub fn load_checkpoint(
&self,
learning_agent: <RLC as RLComponentsTypes>::LearningAgent,
device: &<<RLC as RLComponentsTypes>::Backend as BackendTypes>::Device,
epoch: usize,
) -> <RLC as RLComponentsTypes>::LearningAgent
pub fn load_checkpoint( &self, learning_agent: <RLC as RLComponentsTypes>::LearningAgent, device: &<<RLC as RLComponentsTypes>::Backend as BackendTypes>::Device, epoch: usize, ) -> <RLC as RLComponentsTypes>::LearningAgent
Load a training checkpoint.
Auto Trait Implementations§
impl<RLC> Freeze for RLCheckpointer<RLC>
impl<RLC> !RefUnwindSafe for RLCheckpointer<RLC>
impl<RLC> Send for RLCheckpointer<RLC>
impl<RLC> !Sync for RLCheckpointer<RLC>
impl<RLC> Unpin for RLCheckpointer<RLC>
impl<RLC> !UnwindSafe for RLCheckpointer<RLC>
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