QuantileLayer
chronax.distributions.implicit_quantile_network.QuantileLayer · inherits nn.Module
Implicit Quantile Layer from the paper IQN for Distributional Reinforcement Learning (https://arxiv.org/abs/1806.06923) by Dabney et al. 2018.
__init__(self, num_output: int, cos_embedding_dim: int = 128)
| Parameter |
Type |
Default |
Description |
| num_output |
int |
- |
(undocumented) |
| cos_embedding_dim |
int |
128 |
(undocumented) |
forward(self, tau: torch.Tensor) -> torch.Tensor
| Parameter |
Type |
Default |
Description |
| tau |
torch.Tensor |
- |
(undocumented) |
ImplicitQuantileModule
chronax.distributions.implicit_quantile_network.ImplicitQuantileModule · inherits nn.Module
Implicit Quantile Network from the paper IQN for Distributional Reinforcement Learning (https://arxiv.org/abs/1806.06923) by Dabney et al. 2018.
__init__(self, in_features: int, args_dim: Dict[str, int], domain_map: Callable[..., Tuple[torch.Tensor]], concentration1: float = 1.0, concentration0: float = 1.0, output_domain_map=None, cos_embedding_dim: int = 64)
| Parameter |
Type |
Default |
Description |
| in_features |
int |
- |
(undocumented) |
| args_dim |
Dict[str, int] |
- |
(undocumented) |
| domain_map |
Callable[..., Tuple[torch.Tensor]] |
- |
(undocumented) |
| concentration1 |
float |
1.0 |
(undocumented) |
| concentration0 |
float |
1.0 |
(undocumented) |
| output_domain_map |
- |
None |
(undocumented) |
| cos_embedding_dim |
int |
64 |
(undocumented) |
| Parameter |
Type |
Default |
Description |
| inputs |
torch.Tensor |
- |
(undocumented) |
ImplicitQuantileNetwork
chronax.distributions.implicit_quantile_network.ImplicitQuantileNetwork · inherits Distribution
Distribution class for the Implicit Quantile from which we can sample or calculate the quantile loss.
__init__(self, outputs: torch.Tensor, taus: torch.Tensor, validate_args=None)
| Parameter |
Type |
Default |
Description |
| outputs |
torch.Tensor |
- |
Outputs from the Implicit Quantile Network. |
| taus |
torch.Tensor |
- |
Tensor random numbers from the Beta or Uniform distribution for the corresponding outputs. |
| validate_args |
- |
None |
(undocumented) |
sample(self, sample_shape=torch.Size()) -> torch.Tensor
| Parameter |
Type |
Default |
Description |
| sample_shape |
- |
torch.Size() |
(undocumented) |
quantile_loss(self, value: torch.Tensor) -> torch.Tensor
| Parameter |
Type |
Default |
Description |
| value |
torch.Tensor |
- |
(undocumented) |
ImplicitQuantileNetworkOutput
chronax.distributions.implicit_quantile_network.ImplicitQuantileNetworkOutput · inherits DistributionOutput
DistributionOutput class for the IQN from the paper Probabilistic Time Series Forecasting with Implicit Quantile Networks (https://arxiv.org/abs/2107.03743) by Gouttes et al. 2021.
Attributes:
* distr_cls: ImplicitQuantileNetwork
* args_dim: {'quantile_function': 1}
__init__(self, output_domain: Optional[str] = None, concentration1: float = 1.0, concentration0: float = 1.0, cos_embedding_dim: int = 64) -> None
| Parameter |
Type |
Default |
Description |
| output_domain |
Optional[str] |
None |
Optional domain mapping of the output. Can be "positive", "unit" or None. |
| concentration1 |
float |
1.0 |
Alpha parameter of the Beta distribution when sampling the taus during training. |
| concentration0 |
float |
1.0 |
Beta parameter of the Beta distribution when sampling the taus during training. |
| cos_embedding_dim |
int |
64 |
The embedding dimension for the taus embedding layer of IQN. |
get_args_proj(self, in_features: int) -> nn.Module
| Parameter |
Type |
Default |
Description |
| in_features |
int |
- |
(undocumented) |
domain_map(cls, *args)
| Parameter |
Type |
Default |
Description |
| *args |
- |
- |
(undocumented) |
distribution(self, distr_args, loc=0, scale=None) -> ImplicitQuantileNetwork
| Parameter |
Type |
Default |
Description |
| distr_args |
- |
- |
(undocumented) |
| loc |
- |
0 |
(undocumented) |
| scale |
- |
None |
(undocumented) |
loss(self, target: torch.Tensor, distr_args: Tuple[torch.Tensor, ...], loc: Optional[torch.Tensor] = None, scale: Optional[torch.Tensor] = None) -> torch.Tensor
| Parameter |
Type |
Default |
Description |
| target |
torch.Tensor |
- |
(undocumented) |
| distr_args |
Tuple[torch.Tensor, ...] |
- |
(undocumented) |
| loc |
Optional[torch.Tensor] |
None |
(undocumented) |
| scale |
Optional[torch.Tensor] |
None |
(undocumented) |
iqn
chronax.distributions.implicit_quantile_network.iqn
Instance of ImplicitQuantileNetworkOutput.