Struct border_tch_agent::dqn::DqnConfig
source · pub struct DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,{
pub device: Option<Device>,
/* private fields */
}Expand description
Configuration of Dqn agent.
Fields§
§device: Option<Device>Implementations§
source§impl<Q> DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q> DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
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 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 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 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.
Trait Implementations§
source§impl<Q> Clone for DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q> Clone for DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
source§impl<Q> Debug for DqnConfig<Q>where
Q: SubModel<Output = Tensor> + Debug,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
impl<Q> Debug for DqnConfig<Q>where Q: SubModel<Output = Tensor> + Debug, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
source§impl<Q> Default for DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q> Default for DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
source§impl<'de, Q> Deserialize<'de> for DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<'de, Q> Deserialize<'de> for DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::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> PartialEq<DqnConfig<Q>> for DqnConfig<Q>where
Q: SubModel<Output = Tensor> + PartialEq,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
impl<Q> PartialEq<DqnConfig<Q>> for DqnConfig<Q>where Q: SubModel<Output = Tensor> + PartialEq, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
source§impl<Q> Serialize for DqnConfig<Q>where
Q: SubModel<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q> Serialize for DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
impl<Q> StructuralPartialEq for DqnConfig<Q>where Q: SubModel<Output = Tensor>, Q::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
Auto Trait Implementations§
impl<Q> RefUnwindSafe for DqnConfig<Q>where Q: RefUnwindSafe, <Q as SubModel>::Config: RefUnwindSafe,
impl<Q> Send for DqnConfig<Q>where Q: Send, <Q as SubModel>::Config: Send,
impl<Q> Sync for DqnConfig<Q>where Q: Sync, <Q as SubModel>::Config: Sync,
impl<Q> Unpin for DqnConfig<Q>where Q: Unpin, <Q as SubModel>::Config: Unpin,
impl<Q> UnwindSafe for DqnConfig<Q>where Q: UnwindSafe, <Q as SubModel>::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