pub struct IqnModel<F, M>where
F: SubModel<Output = Tensor>,
M: SubModel<Input = Tensor, Output = Tensor>,
F::Config: DeserializeOwned + Serialize,
M::Config: DeserializeOwned + Serialize,{ /* private fields */ }Expand description
Constructs IQN output layer, which takes input features and percent points. It returns action-value quantiles.
Implementations§
Source§impl<F, M> IqnModel<F, M>
impl<F, M> IqnModel<F, M>
Sourcepub fn build(
config: IqnModelConfig<F::Config, M::Config>,
device: Device,
) -> Result<IqnModel<F, M>>
pub fn build( config: IqnModelConfig<F::Config, M::Config>, device: Device, ) -> Result<IqnModel<F, M>>
Constructs IqnModel.
Sourcepub fn build_with_submodel_configs(
config: IqnModelConfig<F::Config, M::Config>,
f_config: F::Config,
m_config: M::Config,
device: Device,
) -> IqnModel<F, M>
pub fn build_with_submodel_configs( config: IqnModelConfig<F::Config, M::Config>, f_config: F::Config, m_config: M::Config, device: Device, ) -> IqnModel<F, M>
Constructs IqnModel with the given configurations of sub models.
Sourcepub fn forward(&self, x: &F::Input, tau: &Tensor) -> Tensor
pub fn forward(&self, x: &F::Input, tau: &Tensor) -> Tensor
Returns the tensor of action-value quantiles.
- The shape of
psi(x)(feature vector) is [batch_size, feature_dim]. - The shape of
tauis [batch_size, n_percent_points]. - The shape of the output is [batch_size, n_percent_points, self.out_dim].
Trait Implementations§
Auto Trait Implementations§
impl<F, M> Freeze for IqnModel<F, M>
impl<F, M> !RefUnwindSafe for IqnModel<F, M>
impl<F, M> Send for IqnModel<F, M>
impl<F, M> !Sync for IqnModel<F, M>
impl<F, M> Unpin for IqnModel<F, M>
impl<F, M> !UnwindSafe for IqnModel<F, M>
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