pub struct SacConfig<Q, P>where
Q: SubModel2<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P: SubModel1<Output = (Tensor, Tensor)>,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,{
pub actor_config: GaussianActorConfig<P::Config>,
pub critic_config: MultiCriticConfig<Q::Config>,
pub gamma: f64,
pub ent_coef_mode: EntCoefMode,
pub n_updates_per_opt: usize,
pub batch_size: usize,
pub critic_loss: CriticLoss,
pub device: Option<Device>,
}Expand description
Configuration of Sac.
Fields§
§actor_config: GaussianActorConfig<P::Config>Configuration of the actor model.
critic_config: MultiCriticConfig<Q::Config>Configuration of the critic model.
gamma: f64Discont factor.
ent_coef_mode: EntCoefModeHow to update entropy coefficient.
n_updates_per_opt: usizeNumber of parameter updates per optimization step.
batch_size: usizeBatch size for training.
critic_loss: CriticLossType of critic loss function.
device: Option<Device>Device for actor/critic models.
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 critic_loss(self, v: CriticLoss) -> Self
pub fn critic_loss(self, v: CriticLoss) -> Self
Critic loss.
Sourcepub fn actor_config(self, actor_config: GaussianActorConfig<P::Config>) -> Self
pub fn actor_config(self, actor_config: GaussianActorConfig<P::Config>) -> Self
Configuration of actor.
Sourcepub fn critic_config(self, critic_config: MultiCriticConfig<Q::Config>) -> Self
pub fn critic_config(self, critic_config: MultiCriticConfig<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 SubModel1>::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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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