Struct border_tch_agent::sac::SacConfig
source · pub struct SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,{
pub device: Option<Device>,
/* private fields */
}Expand description
Constructs Sac.
Fields§
§device: Option<Device>Implementations§
source§impl<Q, P> SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q, P> SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
sourcepub fn n_updates_per_opt(self, v: usize) -> Self
pub fn n_updates_per_opt(self, v: usize) -> Self
Sets the numper of parameter update steps per optimization step.
sourcepub fn min_transitions_warmup(self, v: usize) -> Self
pub fn min_transitions_warmup(self, v: usize) -> Self
Interval before starting optimization.
sourcepub fn batch_size(self, v: usize) -> Self
pub fn batch_size(self, v: usize) -> Self
Batch size.
sourcepub fn discount_factor(self, v: f64) -> Self
pub fn discount_factor(self, v: f64) -> Self
Discount factor.
sourcepub fn ent_coef_mode(self, v: EntCoefMode) -> Self
pub fn ent_coef_mode(self, v: EntCoefMode) -> Self
SAC-alpha.
sourcepub fn replay_burffer_capacity(self, v: usize) -> Self
pub fn replay_burffer_capacity(self, v: usize) -> Self
Replay buffer capacity.
sourcepub fn reward_scale(self, v: f32) -> Self
pub fn reward_scale(self, v: f32) -> Self
Reward scale.
It works for obtaining target values, not the values in logs.
sourcepub fn critic_loss(self, v: CriticLoss) -> Self
pub fn critic_loss(self, v: CriticLoss) -> Self
Critic loss.
sourcepub fn actor_config(self, actor_config: ActorConfig<P::Config>) -> Self
pub fn actor_config(self, actor_config: ActorConfig<P::Config>) -> Self
Configuration of actor.
sourcepub fn critic_config(self, critic_config: CriticConfig<Q::Config>) -> Self
pub fn critic_config(self, critic_config: CriticConfig<Q::Config>) -> Self
Configuration of critic.
Trait Implementations§
source§impl<Q, P> Clone for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q, P> Clone for SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
source§impl<Q, P> Debug for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor> + Debug,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug,
P: SubModel<Output = (Tensor, Tensor)> + Debug,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
impl<Q, P> Debug for SacConfig<Q, P>where Q: SubModel2<Output = Tensor> + Debug, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug, P: SubModel<Output = (Tensor, Tensor)> + Debug, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
source§impl<Q, P> Default for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q, P> Default for SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
source§impl<'de, Q, P> Deserialize<'de> for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<'de, Q, P> Deserialize<'de> for SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Q, P> PartialEq<SacConfig<Q, P>> for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor> + PartialEq,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq,
P: SubModel<Output = (Tensor, Tensor)> + PartialEq,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
impl<Q, P> PartialEq<SacConfig<Q, P>> for SacConfig<Q, P>where Q: SubModel2<Output = Tensor> + PartialEq, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq, P: SubModel<Output = (Tensor, Tensor)> + PartialEq, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
source§impl<Q, P> Serialize for SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q, P> Serialize for SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q, P> StructuralPartialEq for SacConfig<Q, P>where Q: SubModel2<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone, P: SubModel<Output = (Tensor, Tensor)>, P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
Auto Trait Implementations§
impl<Q, P> RefUnwindSafe for SacConfig<Q, P>where <P as SubModel>::Config: RefUnwindSafe, <Q as SubModel2>::Config: RefUnwindSafe,
impl<Q, P> Send for SacConfig<Q, P>where <P as SubModel>::Config: Send, <Q as SubModel2>::Config: Send,
impl<Q, P> Sync for SacConfig<Q, P>where <P as SubModel>::Config: Sync, <Q as SubModel2>::Config: Sync,
impl<Q, P> Unpin for SacConfig<Q, P>where <P as SubModel>::Config: Unpin, <Q as SubModel2>::Config: Unpin,
impl<Q, P> UnwindSafe for SacConfig<Q, P>where <P as SubModel>::Config: UnwindSafe, <Q as SubModel2>::Config: UnwindSafe,
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