pub struct CandleDeterministicPolicy { /* private fields */ }Implementations§
Source§impl CandleDeterministicPolicy
impl CandleDeterministicPolicy
Sourcepub fn td3_actor_step(
&mut self,
obs: &TensorData,
critic: &CandleTwinQ,
) -> Result<TrainMetrics, NNError>
pub fn td3_actor_step( &mut self, obs: &TensorData, critic: &CandleTwinQ, ) -> Result<TrainMetrics, NNError>
TD3 actor gradient step with autograd flowing through the critic.
Takes concrete CandleTwinQ to preserve gradient flow from Q1(s, a)
back to actor parameters via the deterministic actions.
Trait Implementations§
Source§impl DeterministicPolicy for CandleDeterministicPolicy
impl DeterministicPolicy for CandleDeterministicPolicy
Source§fn act(&self, obs: &TensorData) -> Result<TensorData, NNError>
fn act(&self, obs: &TensorData) -> Result<TensorData, NNError>
Compute deterministic action. Returns [batch_size, act_dim].
Source§fn target_act(&self, obs: &TensorData) -> Result<TensorData, NNError>
fn target_act(&self, obs: &TensorData) -> Result<TensorData, NNError>
Compute target policy action (from target network).
Source§fn soft_update_target(&mut self, tau: f32)
fn soft_update_target(&mut self, tau: f32)
Polyak soft update of target network.
fn learning_rate(&self) -> f32
fn set_learning_rate(&mut self, lr: f32)
fn save(&self, path: &Path) -> Result<(), NNError>
fn load(&mut self, path: &Path) -> Result<(), NNError>
impl Send for CandleDeterministicPolicy
impl Sync for CandleDeterministicPolicy
Auto Trait Implementations§
impl Freeze for CandleDeterministicPolicy
impl !RefUnwindSafe for CandleDeterministicPolicy
impl Unpin for CandleDeterministicPolicy
impl !UnwindSafe for CandleDeterministicPolicy
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