dsipts.models.d3vae.encoder module¶
- Description:
The model architecture of the bidirectional vae. Note: Part of the code are borrowed from ‘https://github.com/NVlabs/NVAE’
- Authors:
Li,Yan (liyan22021121@gmail.com)
- class dsipts.models.d3vae.encoder.Cell(Cin, Cout, cell_type, arch, use_se)[source]¶
Bases:
ModuleInitialize internal Module state, shared by both nn.Module and ScriptModule.
- __init__(Cin, Cout, cell_type, arch, use_se)[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(s)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- dsipts.models.d3vae.encoder.log_density_gaussian(sample, mu, logvar)[source]¶
Calculates log density of a Gaussian. :param x: Value at which to compute the density. :type x: torch.Tensor or np.ndarray or float :param mu: Mean. :type mu: torch.Tensor or np.ndarray or float :param logvar: Log variance. :type logvar: torch.Tensor or np.ndarray or float
- class dsipts.models.d3vae.encoder.Encoder(channel_mult, mult, prediction_length, num_preprocess_blocks, num_preprocess_cells, num_channels_enc, arch_instance, num_latent_per_group, num_channels_dec, groups_per_scale, num_postprocess_blocks, num_postprocess_cells, embedding_dimension, hidden_size, target_dim, sequence_length, num_layers, dropout_rate)[source]¶
Bases:
ModuleInitialize internal Module state, shared by both nn.Module and ScriptModule.
- __init__(channel_mult, mult, prediction_length, num_preprocess_blocks, num_preprocess_cells, num_channels_enc, arch_instance, num_latent_per_group, num_channels_dec, groups_per_scale, num_postprocess_blocks, num_postprocess_cells, embedding_dimension, hidden_size, target_dim, sequence_length, num_layers, dropout_rate)[source]¶
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(x)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.