domainlab.compos.vae package¶
Subpackages¶
- domainlab.compos.vae.compos package
- Submodules
- domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv module
- domainlab.compos.vae.compos.decoder_concat_vec_reshape_conv_gated_conv module
- domainlab.compos.vae.compos.decoder_cond_prior module
- domainlab.compos.vae.compos.decoder_losses module
- domainlab.compos.vae.compos.encoder module
- 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
- domainlab.compos.vae.compos.encoder_xydt_elevator module
- domainlab.compos.vae.compos.encoder_zy module
- Module contents
Submodules¶
domainlab.compos.vae.a_model_builder module¶
Integrate Chain-of-Responsibility and Builder Patter to construct VAE encoder and decoder
- class domainlab.compos.vae.a_model_builder.AbstractModelBuilderChainNode(success_node=None)[source]¶
Bases:
AbstractChainNodeHandler
to ensure chain of responsibility node AbstractChainNodeHandler always work even some node can not start their heavy weight business object, avoid override the initializer so that node construction is always light weight.
The config() method here is abstract, while child class has a concrete config method
domainlab.compos.vae.a_vae_builder module¶
Integrate Chain-of-Responsibility and Builder Patter to construct VAE encoder and decoder
- class domainlab.compos.vae.a_vae_builder.AbstractVAEBuilderChainNode(successor_node)[source]¶
Bases:
AbstractChainNodeHandler
to ensure chain of responsibility node AbstractChainNodeHandler always work even some node can not start their heavy weight business object, avoid override the initializer so that node construction is always light weight.
domainlab.compos.vae.c_vae_adaptor_model_recon module¶
This adaptor couples intensively with the heavy-weight model class The model class can be refactored, we do want to use the trained old-version model, which we only need to change this adaptor class.
- class domainlab.compos.vae.c_vae_adaptor_model_recon.AdaptorReconVAEXYD(model)[source]¶
Bases:
object
This adaptor couples intensively with the heavy-weight model class The model class can be refactored, we do want to use the trained old-version model, which we only need to change this adaptor class.
- cal_latent(x)[source]¶
This method won’t be redundant as it will be used several times, and most importantly, it couples with the models encoder attribute, so we only need to change this one time. Suppose if model class changes, to use old trained models(we can not retrain them), we only need to change this method. :param x:
- recon_ydx(zy, zd, zx, x)[source]¶
The order of concatnation plays a vital role!
2. This method won’t be redundant as it will be used several times, and most importantly, it couples with the models encoder attribute, so we only need to change this one time. Suppose if model class changes, to use old trained models(we can not retrain them), we only need to change this method.
domainlab.compos.vae.c_vae_builder_classif module¶
Builder 1. classifier for domain and class 2. p(z_y|y) and p(z_d|d)
- class domainlab.compos.vae.c_vae_builder_classif.ChainNodeVAEBuilderClassifCondPrior(successor_node)[source]¶
Bases:
AbstractVAEBuilderChainNode
- This class defines common methods shared by child classes:
classifier for domain/class
conditional prior
Bridge pattern: separate abstraction (vae model) and implementation)
domainlab.compos.vae.c_vae_recon module¶
Adaptor is vital for data generation so this class can be decoupled from model class. The model class can be refactored, we do want to use the trained old-version model, which we only need to change adaptor class.
- class domainlab.compos.vae.c_vae_recon.ReconVAEXYD(model, na_adaptor=<class 'domainlab.compos.vae.c_vae_adaptor_model_recon.AdaptorReconVAEXYD'>)[source]¶
Bases:
object
Adaptor is vital for data generation so this class can be decoupled from model class. The model class can be refactored, we do want to use the trained old-version model, which we only need to change adaptor class.
domainlab.compos.vae.utils_request_chain_builder module¶
- class domainlab.compos.vae.utils_request_chain_builder.VAEChainNodeGetter(request, topic_dim=None)[source]¶
Bases:
object
Hardcoded chain, each node use Scenario as request class
Constructor takes parameters for VABuilder Subclasses
heavy weight business objective is returned by selected node
convert Scenario object to request object, so that class can be reused
domainlab.compos.vae.zoo_vae_builders_classif module¶
Chain node VAE builders
- class domainlab.compos.vae.zoo_vae_builders_classif.ChainNodeVAEBuilderClassifCondPriorBase(successor_node)[source]¶
Bases:
ChainNodeVAEBuilderClassifCondPrior
base class of AE builder
- class domainlab.compos.vae.zoo_vae_builders_classif.NodeVAEBuilderArg(successor_node)[source]¶
Bases:
ChainNodeVAEBuilderClassifCondPriorBase
Build encoder decoder according to commandline arguments
- class domainlab.compos.vae.zoo_vae_builders_classif.NodeVAEBuilderImgAlex(successor_node)[source]¶
Bases:
NodeVAEBuilderImgConvBnPool
domainlab.compos.vae.zoo_vae_builders_classif_topic module¶
Chain node VAE builders
- class domainlab.compos.vae.zoo_vae_builders_classif_topic.NodeVAEBuilderImgTopic(successor_node)[source]¶
Bases:
NodeVAEBuilderArg
NodeVAEBuilderImgTopic.