pub struct DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,{Show 15 fields
pub model_config: DqnModelConfig<Q::Config>,
pub soft_update_interval: usize,
pub n_updates_per_opt: usize,
pub batch_size: usize,
pub discount_factor: f64,
pub tau: f64,
pub train: bool,
pub explorer: DqnExplorer,
pub clip_reward: Option<f64>,
pub double_dqn: bool,
pub clip_td_err: Option<(f64, f64)>,
pub device: Option<Device>,
pub critic_loss: CriticLoss,
pub record_verbose_level: usize,
pub phantom: PhantomData<Q>,
}Expand description
Configuration of Dqn agent.
Fields§
§model_config: DqnModelConfig<Q::Config>§soft_update_interval: usize§n_updates_per_opt: usize§batch_size: usize§discount_factor: f64§tau: f64§train: bool§explorer: DqnExplorer§clip_reward: Option<f64>§double_dqn: bool§clip_td_err: Option<(f64, f64)>§device: Option<Device>§critic_loss: CriticLoss§record_verbose_level: usize§phantom: PhantomData<Q>Implementations§
Source§impl<Q> DqnConfig<Q>
impl<Q> DqnConfig<Q>
Sourcepub fn soft_update_interval(self, v: usize) -> Self
pub fn soft_update_interval(self, v: usize) -> Self
Sets soft update interval.
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 explorer(self, v: DqnExplorer) -> Self
pub fn explorer(self, v: DqnExplorer) -> Self
Explorer.
Sourcepub fn model_config(self, model_config: DqnModelConfig<Q::Config>) -> Self
pub fn model_config(self, model_config: DqnModelConfig<Q::Config>) -> Self
Sets the configuration of the model.
Sourcepub fn opt_config(self, opt_config: OptimizerConfig) -> Self
pub fn opt_config(self, opt_config: OptimizerConfig) -> Self
Sets the configration of the optimizer.
Sourcepub fn out_dim(self, out_dim: i64) -> Self
pub fn out_dim(self, out_dim: i64) -> Self
Sets the output dimention of the dqn model of the DQN agent.
Sourcepub fn clip_reward(self, clip_reward: Option<f64>) -> Self
pub fn clip_reward(self, clip_reward: Option<f64>) -> Self
Reward clipping.
Sourcepub fn double_dqn(self, double_dqn: bool) -> Self
pub fn double_dqn(self, double_dqn: bool) -> Self
Double DQN
Sourcepub fn clip_td_err(self, clip_td_err: Option<(f64, f64)>) -> Self
pub fn clip_td_err(self, clip_td_err: Option<(f64, f64)>) -> Self
TD-error clipping.
Sourcepub fn critic_loss(self, v: CriticLoss) -> Self
pub fn critic_loss(self, v: CriticLoss) -> Self
Sets critic loss.
Sourcepub fn record_verbose_level(self, v: usize) -> Self
pub fn record_verbose_level(self, v: usize) -> Self
Sets verbose level.
Trait Implementations§
Source§impl<'de, Q> Deserialize<'de> for DqnConfig<Q>
impl<'de, Q> Deserialize<'de> for DqnConfig<Q>
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> StructuralPartialEq for DqnConfig<Q>
Auto Trait Implementations§
impl<Q> Freeze for DqnConfig<Q>
impl<Q> RefUnwindSafe for DqnConfig<Q>
impl<Q> Send for DqnConfig<Q>
impl<Q> Sync for DqnConfig<Q>
impl<Q> Unpin for DqnConfig<Q>
impl<Q> UnwindSafe for DqnConfig<Q>
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