pub struct LinearQFunction<T: Float + Debug + Send + Sync + 'static> { /* private fields */ }Expand description
Action-value function linear in the state-action features
φ(s,a) = [ s ; a ; vec(s aᵀ) ] Q(s,a) = w · φ(s,a)The bilinear s aᵀ block is what makes the deterministic policy gradient
non-trivial: without it ∇_a Q would be a constant vector and every DPG step
would push the actor to the same saturated action regardless of the state.
ValueNetwork::evaluate_value deliberately returns
OptimError::UnsupportedOperation: a Q function has no state value without a
policy to average over, and silently returning Q(s, 0) would be a trap.
Implementations§
Trait Implementations§
Source§impl<T: Clone + Float + Debug + Send + Sync + 'static> Clone for LinearQFunction<T>
impl<T: Clone + Float + Debug + Send + Sync + 'static> Clone for LinearQFunction<T>
Source§fn clone(&self) -> LinearQFunction<T>
fn clone(&self) -> LinearQFunction<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Float + Debug + Send + Sync + 'static> QNetwork<T> for LinearQFunction<T>
impl<T: Float + Debug + Send + Sync + 'static> QNetwork<T> for LinearQFunction<T>
Source§fn evaluate_q(
&self,
states: &Array2<T>,
actions: &Array2<T>,
) -> Result<Array1<T>>
fn evaluate_q( &self, states: &Array2<T>, actions: &Array2<T>, ) -> Result<Array1<T>>
Evaluate
Q(s, a) for a batch of state-action pairs.Source§impl<T: Float + Debug + Send + Sync + 'static> ValueNetwork<T> for LinearQFunction<T>
impl<T: Float + Debug + Send + Sync + 'static> ValueNetwork<T> for LinearQFunction<T>
Auto Trait Implementations§
impl<T> Freeze for LinearQFunction<T>
impl<T> RefUnwindSafe for LinearQFunction<T>where
T: RefUnwindSafe,
impl<T> Send for LinearQFunction<T>
impl<T> Sync for LinearQFunction<T>
impl<T> Unpin for LinearQFunction<T>
impl<T> UnsafeUnpin for LinearQFunction<T>
impl<T> UnwindSafe for LinearQFunction<T>where
T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.