pub struct IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,{
pub value_config: ValueConfig<V::Config>,
pub critic_config: MultiCriticConfig<Q::Config>,
pub actor_config: GaussianActorConfig<P::Config>,
pub gamma: f32,
pub tau_iql: f64,
pub inv_lambda: f64,
pub n_updates_per_opt: usize,
pub batch_size: usize,
pub adv_softmax: bool,
pub critic_loss: CriticLoss,
pub device: Option<Device>,
pub exp_adv_max: f64,
}Expand description
Configuration of Iql.
Fields§
§value_config: ValueConfig<V::Config>Configuration of the value model.
critic_config: MultiCriticConfig<Q::Config>Configuration of the critic model.
actor_config: GaussianActorConfig<P::Config>Configuration of the actor model.
gamma: f32Discont factor.
tau_iql: f64Expectile value.
inv_lambda: f64The inverse of lambda in the paper.
n_updates_per_opt: usizeNumber of parameter updates per optimization step.
batch_size: usizeBatch size for training.
adv_softmax: boolIf true, advantage weights are calculated with softmax within each mini-batch.
critic_loss: CriticLossType of critic loss function.
device: Option<Device>Device used for the actor and critic models (e.g., CPU or GPU).
exp_adv_max: f64Maximum of exponent of advantage.
Implementations§
Source§impl<Q, P, V> IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<Q, P, V> IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + 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 batch_size(self, v: usize) -> Self
pub fn batch_size(self, v: usize) -> Self
Batch size.
Sourcepub fn discount_factor(self, v: f32) -> Self
pub fn discount_factor(self, v: f32) -> Self
Discount factor.
Sourcepub fn critic_loss(self, v: CriticLoss) -> Self
pub fn critic_loss(self, v: CriticLoss) -> Self
Critic loss.
Sourcepub fn value_config(self, value_config: ValueConfig<V::Config>) -> Self
pub fn value_config(self, value_config: ValueConfig<V::Config>) -> Self
Configuration of value function.
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.
Sourcepub fn adv_softmax(self, b: bool) -> Self
pub fn adv_softmax(self, b: bool) -> Self
If true, advantage weights are calculated with softmax within each mini-batch.
Trait Implementations§
Source§impl<Q, P, V> Clone for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<Q, P, V> Clone for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
Source§impl<Q, P, V> Debug for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor> + Debug,
P: SubModel1<Output = (Tensor, Tensor)> + Debug,
V: SubModel1<Output = Tensor> + Debug,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug,
impl<Q, P, V> Debug for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor> + Debug,
P: SubModel1<Output = (Tensor, Tensor)> + Debug,
V: SubModel1<Output = Tensor> + Debug,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + Debug,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + Debug,
Source§impl<Q, P, V> Default for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<Q, P, V> Default for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
Source§impl<'de, Q, P, V> Deserialize<'de> for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<'de, Q, P, V> Deserialize<'de> for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + 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, V> PartialEq for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor> + PartialEq,
P: SubModel1<Output = (Tensor, Tensor)> + PartialEq,
V: SubModel1<Output = Tensor> + PartialEq,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq,
impl<Q, P, V> PartialEq for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor> + PartialEq,
P: SubModel1<Output = (Tensor, Tensor)> + PartialEq,
V: SubModel1<Output = Tensor> + PartialEq,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone + PartialEq,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone + PartialEq,
Source§impl<Q, P, V> Serialize for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<Q, P, V> Serialize for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
impl<Q, P, V> StructuralPartialEq for IqlConfig<Q, P, V>where
Q: SubModel2<Output = Tensor>,
P: SubModel1<Output = (Tensor, Tensor)>,
V: SubModel1<Output = Tensor>,
Q::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
P::Config: DeserializeOwned + Serialize + OutDim + Debug + PartialEq + Clone,
V::Config: DeserializeOwned + Serialize + Debug + PartialEq + Clone,
Auto Trait Implementations§
impl<Q, P, V> Freeze for IqlConfig<Q, P, V>
impl<Q, P, V> RefUnwindSafe for IqlConfig<Q, P, V>where
<V as SubModel1>::Config: Sized + RefUnwindSafe,
<P as SubModel1>::Config: Sized + RefUnwindSafe,
<Q as SubModel2>::Config: Sized + RefUnwindSafe,
impl<Q, P, V> Send for IqlConfig<Q, P, V>
impl<Q, P, V> Sync for IqlConfig<Q, P, V>
impl<Q, P, V> Unpin for IqlConfig<Q, P, V>
impl<Q, P, V> UnwindSafe for IqlConfig<Q, P, V>where
<V as SubModel1>::Config: Sized + UnwindSafe,
<P as SubModel1>::Config: Sized + UnwindSafe,
<Q as SubModel2>::Config: Sized + 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
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