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: Module

Initialize 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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

dsipts.models.d3vae.encoder.soft_clamp5(x)[source]
dsipts.models.d3vae.encoder.sample_normal_jit(mu, sigma)[source]
class dsipts.models.d3vae.encoder.Normal(mu, log_sigma, temp=1.)[source]

Bases: object

__init__(mu, log_sigma, temp=1.)[source]
sample()[source]
sample_given_eps(eps)[source]
log_p(samples)[source]
kl(normal_dist)[source]
class dsipts.models.d3vae.encoder.NormalDecoder(param)[source]

Bases: object

__init__(param)[source]
log_prob(samples)[source]
sample()[source]
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: Module

Initialize 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.

init_pre_process(mult)[source]
init_encoder_tower(mult)[source]
init_decoder_tower(mult)[source]
init_sampler(mult)[source]
init_post_process(mult)[source]
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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

decoder_output(logits)[source]