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,{Show 16 fields
pub actor_config: ActorConfig<P::Config>,
pub critic_config: CriticConfig<Q::Config>,
pub gamma: f64,
pub tau: f64,
pub ent_coef_mode: EntCoefMode,
pub epsilon: f64,
pub min_lstd: f64,
pub max_lstd: f64,
pub n_updates_per_opt: usize,
pub batch_size: usize,
pub train: bool,
pub critic_loss: CriticLoss,
pub reward_scale: f32,
pub n_critics: usize,
pub seed: Option<i64>,
pub device: Option<Device>,
}Expand description
Configuration of Sac.
Fields§
§actor_config: ActorConfig<P::Config>§critic_config: CriticConfig<Q::Config>§gamma: f64§tau: f64§ent_coef_mode: EntCoefMode§epsilon: f64§min_lstd: f64§max_lstd: f64§n_updates_per_opt: usize§batch_size: usize§train: bool§critic_loss: CriticLoss§reward_scale: f32§n_critics: usize§seed: Option<i64>§device: Option<Device>Implementations§
Source§impl<Q, P> SacConfig<Q, P>
impl<Q, P> SacConfig<Q, P>
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 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 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<'de, Q, P> Deserialize<'de> for SacConfig<Q, P>
impl<'de, Q, P> Deserialize<'de> for SacConfig<Q, P>
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
impl<Q, P> StructuralPartialEq for SacConfig<Q, P>
Auto Trait Implementations§
impl<Q, P> Freeze for SacConfig<Q, P>
impl<Q, P> RefUnwindSafe for SacConfig<Q, P>where
<P as SubModel>::Config: Sized + RefUnwindSafe,
<Q as SubModel2>::Config: Sized + RefUnwindSafe,
impl<Q, P> Send for SacConfig<Q, P>
impl<Q, P> Sync for SacConfig<Q, P>
impl<Q, P> Unpin for SacConfig<Q, P>
impl<Q, P> UnwindSafe for SacConfig<Q, P>
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