Struct border_tch_agent::sac::SAC
source · [−]pub struct SAC<E, Q, P, R> where
E: Env,
Q: SubModel2<Output = Tensor>,
P: SubModel<Output = (Tensor, Tensor)>,
R: ReplayBufferBase,
E::Obs: Into<Q::Input1> + Into<P::Input>,
E::Act: Into<Q::Input2>,
Q::Input2: From<Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
<R::Batch as Batch>::ObsBatch: Into<Q::Input1> + Into<P::Input> + Clone,
<R::Batch as Batch>::ActBatch: Into<Q::Input2> + Into<Tensor>, { /* private fields */ }Expand description
Soft actor critic (SAC) agent.
Trait Implementations
impl<E, Q, P, R> Agent<E, R> for SAC<E, Q, P, R> where
E: Env,
Q: SubModel2<Output = Tensor>,
P: SubModel<Output = (Tensor, Tensor)>,
R: ReplayBufferBase,
E::Obs: Into<Q::Input1> + Into<P::Input>,
E::Act: Into<Q::Input2> + From<Tensor>,
Q::Input2: From<Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
<R::Batch as Batch>::ObsBatch: Into<Q::Input1> + Into<P::Input> + Clone,
<R::Batch as Batch>::ActBatch: Into<Q::Input2> + Into<Tensor>,
impl<E, Q, P, R> Agent<E, R> for SAC<E, Q, P, R> where
E: Env,
Q: SubModel2<Output = Tensor>,
P: SubModel<Output = (Tensor, Tensor)>,
R: ReplayBufferBase,
E::Obs: Into<Q::Input1> + Into<P::Input>,
E::Act: Into<Q::Input2> + From<Tensor>,
Q::Input2: From<Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
<R::Batch as Batch>::ObsBatch: Into<Q::Input1> + Into<P::Input> + Clone,
<R::Batch as Batch>::ActBatch: Into<Q::Input2> + Into<Tensor>,
Save the agent in the given directory.
This method commonly creates a number of files consisting the agent
in the directory. For example, the DQN agent in border_tch_agent crate saves
two Q-networks corresponding to the original and target networks. Read more