Struct border::agent::tch::sac::base::SAC [−][src]
pub struct SAC<E, Q, P, O, A> where
E: Env,
Q: SubModel2<Output = Tensor>,
P: SubModel<Output = (Tensor, Tensor)>,
O: TchBuffer<Item = E::Obs>,
A: TchBuffer<Item = E::Act>, { /* fields omitted */ }
Expand description
Soft actor critic agent.
Trait Implementations
impl<E, Q, P, O, A> Agent<E> for SAC<E, Q, P, O, A> where
E: Env,
Q: SubModel2<Input1 = O::SubBatch, Input2 = A::SubBatch, Output = Tensor>,
P: SubModel<Input = O::SubBatch, Output = (Tensor, Tensor)>,
E::Obs: Into<O::SubBatch>,
E::Act: From<Tensor>,
O: TchBuffer<Item = E::Obs>,
A: TchBuffer<Item = E::Act, SubBatch = Tensor>,
[src]
impl<E, Q, P, O, A> Agent<E> for SAC<E, Q, P, O, A> where
E: Env,
Q: SubModel2<Input1 = O::SubBatch, Input2 = A::SubBatch, Output = Tensor>,
P: SubModel<Input = O::SubBatch, Output = (Tensor, Tensor)>,
E::Obs: Into<O::SubBatch>,
E::Act: From<Tensor>,
O: TchBuffer<Item = E::Obs>,
A: TchBuffer<Item = E::Act, SubBatch = Tensor>,
[src]fn observe(&mut self, step: Step<E>) -> Option<Record>
[src]
fn observe(&mut self, step: Step<E>) -> Option<Record>
[src]Update model parameters.
When the return value is Some(Record)
, it includes:
loss_critic
: Loss of criticloss_actor
: Loss of actor
fn push_obs(&self, obs: &E::Obs)
[src]
fn push_obs(&self, obs: &E::Obs)
[src]Push observation to the agent. This method is used when resetting the environment. Read more
fn save<T: AsRef<Path>>(&self, path: T) -> Result<(), Box<dyn Error>>
[src]
fn save<T: AsRef<Path>>(&self, path: T) -> Result<(), Box<dyn Error>>
[src]Save the agent in the given directory.
This method commonly creates a number of files consisting the agent
into the given directory. For example, [crate::agent::tch::dqn::DQN
] agent saves
two Q-networks corresponding to the original and target networks. Read more
impl<E, Q, P, O, A> Policy<E> for SAC<E, Q, P, O, A> where
E: Env,
Q: SubModel2<Input1 = O::SubBatch, Input2 = A::SubBatch, Output = Tensor>,
P: SubModel<Input = O::SubBatch, Output = (Tensor, Tensor)>,
E::Obs: Into<O::SubBatch>,
E::Act: From<Tensor>,
O: TchBuffer<Item = E::Obs>,
A: TchBuffer<Item = E::Act, SubBatch = Tensor>,
[src]
impl<E, Q, P, O, A> Policy<E> for SAC<E, Q, P, O, A> where
E: Env,
Q: SubModel2<Input1 = O::SubBatch, Input2 = A::SubBatch, Output = Tensor>,
P: SubModel<Input = O::SubBatch, Output = (Tensor, Tensor)>,
E::Obs: Into<O::SubBatch>,
E::Act: From<Tensor>,
O: TchBuffer<Item = E::Obs>,
A: TchBuffer<Item = E::Act, SubBatch = Tensor>,
[src]Auto Trait Implementations
impl<E, Q, P, O, A> !RefUnwindSafe for SAC<E, Q, P, O, A>
impl<E, Q, P, O, A> Send for SAC<E, Q, P, O, A> where
A: Send,
E: Send,
O: Send,
P: Send,
Q: Send,
<E as Env>::Obs: Send,
A: Send,
E: Send,
O: Send,
P: Send,
Q: Send,
<E as Env>::Obs: Send,
impl<E, Q, P, O, A> !Sync for SAC<E, Q, P, O, A>
impl<E, Q, P, O, A> Unpin for SAC<E, Q, P, O, A> where
A: Unpin,
E: Unpin,
O: Unpin,
P: Unpin,
Q: Unpin,
<E as Env>::Obs: Unpin,
A: Unpin,
E: Unpin,
O: Unpin,
P: Unpin,
Q: Unpin,
<E as Env>::Obs: Unpin,
impl<E, Q, P, O, A> UnwindSafe for SAC<E, Q, P, O, A> where
A: UnwindSafe,
E: UnwindSafe,
O: UnwindSafe,
P: UnwindSafe,
Q: UnwindSafe,
<E as Env>::Obs: UnwindSafe,
A: UnwindSafe,
E: UnwindSafe,
O: UnwindSafe,
P: UnwindSafe,
Q: UnwindSafe,
<E as Env>::Obs: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,