pub struct OnPolicyAlgorithm<A: Agent, S: Sampler, H: OnPolicyAlgorithmHooks<A = A, S = S>> {
pub runtime: OnPolicyRuntime<A, S>,
pub hooks: H,
}Expand description
Generic on-policy training loop combining a runtime with lifecycle hooks.
Fields§
§runtime: OnPolicyRuntime<A, S>Coupled training runtime.
hooks: HLifecycle hooks.
Implementations§
Source§impl<A: Agent, S: Sampler, H: OnPolicyAlgorithmHooks<A = A, S = S>> OnPolicyAlgorithm<A, S, H>
impl<A: Agent, S: Sampler, H: OnPolicyAlgorithmHooks<A = A, S = S>> OnPolicyAlgorithm<A, S, H>
Sourcepub fn new(runtime: OnPolicyRuntime<A, S>, hooks: H) -> Self
pub fn new(runtime: OnPolicyRuntime<A, S>, hooks: H) -> Self
Creates an on-policy algorithm from its runtime and lifecycle hooks.
Auto Trait Implementations§
impl<A, S, H> Freeze for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> RefUnwindSafe for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> Send for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> Sync for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> Unpin for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> UnsafeUnpin for OnPolicyAlgorithm<A, S, H>
impl<A, S, H> UnwindSafe for OnPolicyAlgorithm<A, S, H>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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