domainlab.compos.vae.compos package¶
Submodules¶
domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv module¶
decoder which takes concatenated latent representation
- class domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv.DecoderConcatLatentFcReshapeConv(z_dim, i_c, i_h, i_w, cls_fun_nll_p_x, net_fc_z2flat_img, net_conv, net_p_x_mean, net_p_x_log_var)[source]¶
Bases:
Module
Latent vector re-arranged to image-size directly, then convolute to get the textures of the original image
domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv_gated_conv module¶
Bridge Pattern: Separation of interface and implementation. This class is using one implementation to feed into parent class constructor.
- class domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv_gated_conv.DecoderConcatLatentFCReshapeConvGatedConv(z_dim, i_c, i_h, i_w)[source]¶
Bases:
DecoderConcatLatentFcReshapeConv
Bridge Pattern: Separation of interface and implementation. This class is using implementation to feed into parent class constructor. Latent vector re-arranged to image-size directly, then convolute to get the textures of the original image
domainlab.compos.vae.compos.decoder_cond_prior module¶
domainlab.compos.vae.compos.decoder_losses module¶
Upon pixel wise mean and variance
- class domainlab.compos.vae.compos.decoder_losses.NLLPixelLogistic256(reduce_dims=(1, 2, 3), bin_size=0.00390625)[source]¶
Bases:
object
Compute pixel wise negative likelihood of image, given pixel wise mean and variance. Pixel intensity is divided into bins of 256 levels. p.d.f. is calculated through c.d.f.(x_{i,j}+bin_size/scale) - c.d.f.(x_{i,j}) # https://github.com/openai/iaf/blob/master/tf_utils/distributions.py#L29
domainlab.compos.vae.compos.encoder module¶
Pytorch image: i_channel, i_h, i_w Location-Scale Encoder: SoftPlus
domainlab.compos.vae.compos.encoder_dirichlet module¶
domainlab.compos.vae.compos.encoder_domain_topic module¶
domainlab.compos.vae.compos.encoder_domain_topic_img2topic module¶
domainlab.compos.vae.compos.encoder_domain_topic_img_topic2zd module¶
domainlab.compos.vae.compos.encoder_xyd_parallel module¶
- class domainlab.compos.vae.compos.encoder_xyd_parallel.XYDEncoderParallel(net_infer_zd, net_infer_zx, net_infer_zy)[source]¶
Bases:
Module
calculate zx, zy, zd vars independently (without order, parallel): x->zx, x->zy, x->zd
- class domainlab.compos.vae.compos.encoder_xyd_parallel.XYDEncoderParallelAlex(zd_dim, zx_dim, zy_dim, i_c, i_h, i_w, args, conv_stride=1)[source]¶
Bases:
XYDEncoderParallel
This class only reimplemented constructor of parent class, at the end of the constructor of this class, the parent class contructor is called
- class domainlab.compos.vae.compos.encoder_xyd_parallel.XYDEncoderParallelConvBnReluPool(zd_dim, zx_dim, zy_dim, i_c, i_h, i_w, conv_stride=1)[source]¶
Bases:
XYDEncoderParallel
This class only reimplemented constructor of parent class
- class domainlab.compos.vae.compos.encoder_xyd_parallel.XYDEncoderParallelExtern(zd_dim, zx_dim, zy_dim, args, i_c, i_h, i_w, conv_stride=1)[source]¶
Bases:
XYDEncoderParallel
This class only reimplemented constructor of parent class, at the end of the constructor of this class, the parent class contructor is called
- class domainlab.compos.vae.compos.encoder_xyd_parallel.XYDEncoderParallelUser(net_class_d, net_x, net_class_y)[source]¶
Bases:
XYDEncoderParallel
This class only reimplemented constructor of parent class
domainlab.compos.vae.compos.encoder_xydt_elevator module¶
- class domainlab.compos.vae.compos.encoder_xydt_elevator.XYDTEncoderArg(device, topic_dim, zd_dim, zx_dim, zy_dim, i_c, i_h, i_w, args)[source]¶
Bases:
XYDTEncoderElevator
This class only reimplemented constructor of parent class
- class domainlab.compos.vae.compos.encoder_xydt_elevator.XYDTEncoderElevator(net_infer_zd_topic, net_infer_zx, net_infer_zy)[source]¶
Bases:
Module
x->zx, x->zy, x->s, (x,s)->zd
domainlab.compos.vae.compos.encoder_zy module¶
- class domainlab.compos.vae.compos.encoder_zy.EncoderConnectLastFeatLayer2Z(z_dim, flag_pretrain, i_c, i_h, i_w, args, arg_name, arg_path_name)[source]¶
Bases:
Module
Connect the last layer of a feature extraction neural network to the latent representation This class should be transparent to where to fetch the network