pub struct CandleDQN { /* private fields */ }Implementations§
Trait Implementations§
Source§impl QFunction for CandleDQN
impl QFunction for CandleDQN
Source§fn q_values(&self, obs: &TensorData) -> Result<TensorData, NNError>
fn q_values(&self, obs: &TensorData) -> Result<TensorData, NNError>
Compute Q-values for all actions. Returns [batch_size, n_actions].
Source§fn q_value_at(
&self,
obs: &TensorData,
actions: &TensorData,
) -> Result<TensorData, NNError>
fn q_value_at( &self, obs: &TensorData, actions: &TensorData, ) -> Result<TensorData, NNError>
Compute Q-value for (obs, action) pairs. Returns [batch_size].
Source§fn td_step(
&mut self,
obs: &TensorData,
actions: &TensorData,
targets: &TensorData,
weights: Option<&TensorData>,
) -> Result<(f64, TensorData), NNError>
fn td_step( &mut self, obs: &TensorData, actions: &TensorData, targets: &TensorData, weights: Option<&TensorData>, ) -> Result<(f64, TensorData), NNError>
Perform one DQN TD gradient step.
Returns (loss, td_errors) where td_errors can be used for PER.
Source§fn target_q_values(&self, obs: &TensorData) -> Result<TensorData, NNError>
fn target_q_values(&self, obs: &TensorData) -> Result<TensorData, NNError>
Compute target Q-values using the target network.
Source§fn hard_update_target(&mut self)
fn hard_update_target(&mut self)
Hard-copy parameters to the target network.
impl Send for CandleDQN
impl Sync for CandleDQN
Auto Trait Implementations§
impl Freeze for CandleDQN
impl !RefUnwindSafe for CandleDQN
impl Unpin for CandleDQN
impl !UnwindSafe for CandleDQN
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