A dictionary that contains the hyper-parameters of NetworkGraves.
| 20 | |
| 21 | |
| 22 | class ParamVRNN(HyperParams): |
| 23 | """A dictionary that contains the hyper-parameters of NetworkGraves.""" |
| 24 | |
| 25 | def __init__( |
| 26 | self, |
| 27 | param_graves: ParamGraves = ParamGraves(), |
| 28 | dim_latent: int = HyperParams.TBD.INT, # actual dimension of the latent variable |
| 29 | dim_f: int = HyperParams.TBD.INT, # feature dimension |
| 30 | # side information |
| 31 | dim_g: int = 0, # side information |
| 32 | # query net |
| 33 | dim_query: int = 256, # dimension of posterior query |
| 34 | num_query_layers: int = 1, |
| 35 | dim_query_layers: T.Union[int, T.Sequence[int]] = 256, # feature dimension of the query net (#layer -1) |
| 36 | query_add_norm: bool = False, # whether to add layer norm to the query net |
| 37 | query_dropout_prob: float = 0.0, |
| 38 | query_nonlinearity: str = "relu", |
| 39 | # multi-head attention |
| 40 | num_attn_heads: int = 4, |
| 41 | attn_dropout_prob: float = 0.1, |
| 42 | # posterior |
| 43 | num_posterior_layers: int = 1, |
| 44 | dim_posterior_layers: T.Union[int, T.Sequence[int]] = 256, |
| 45 | min_posterior_std: float = 0.0, |
| 46 | # feature dimension of the posterior net (#layer -1) |
| 47 | posterior_add_norm: bool = False, # whether to add layer norm |
| 48 | posterior_dropout_prob: float = 0.0, |
| 49 | posterior_type="indep", |
| 50 | posterior_nonlinearity: str = "relu", |
| 51 | # prior |
| 52 | num_prior_layers: int = 1, |
| 53 | dim_prior_layers: T.Union[int, T.Sequence[int]] = 256, # feature dimension of the prior net (#layer -1) |
| 54 | prior_add_norm: bool = False, # whether to add layer norm |
| 55 | prior_dropout_prob: float = 0.0, |
| 56 | prior_nonlinearity: str = "relu", |
| 57 | min_prior_std: float = 0.0, |
| 58 | # transform |
| 59 | num_transform_layers: int = 1, |
| 60 | dim_transform_layers: T.Union[int, T.Sequence[int]] = 256, # feature dimension (#layer -1) |
| 61 | transform_add_norm: bool = False, |
| 62 | transform_dropout_prob: float = 0.0, |
| 63 | transform_nonlinearity: str = "relu", |
| 64 | flag_bckwrd_compatible: bool = False, # set to True to load older pre-trained model |
| 65 | ): |
| 66 | """ |
| 67 | Create Variational RNN. |
| 68 | |
| 69 | Args: |
| 70 | param_graves: |
| 71 | Please see the documentation of :py:class:`ParamGraves`. |
| 72 | dim_latent: int |
| 73 | Actual dimension of the latent variable. |
| 74 | Note that it can be different from dim_z, which is the actual input dimension to net_graves. |
| 75 | dim_f: int |
| 76 | Feature dimension used to extract latent variables from with attention. |
| 77 | |
| 78 | .. side information |
| 79 | dim_g: int |