Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use parent init_component #200

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7fe41a5
use parent init_component
smilesun Apr 13, 2023
33d74d3
Merge branch 'master' into hduva_init_component
smilesun Apr 18, 2023
dc7bbdd
Merge branch 'master' into hduva_init_component
smilesun Apr 20, 2023
27ba0ca
remove y in interface vae xyd
smilesun Apr 20, 2023
445321f
add net_p_zy
smilesun Apr 20, 2023
4fdca2b
Merge branch 'master' into hduva_init_component
smilesun Apr 20, 2023
a190776
Merge branch 'master' into hduva_init_component
smilesun Jun 13, 2023
b172f6e
Merge branch 'master' into hduva_init_component
smilesun Jun 16, 2023
6879560
Merge branch 'master' into hduva_init_component
smilesun Jun 22, 2023
4578927
Merge branch 'master' into hduva_init_component
smilesun Jul 4, 2023
fecfacf
Merge branch 'master' into hduva_init_component
smilesun Jul 4, 2023
88bd9bc
Merge branch 'master' into hduva_init_component
smilesun Aug 4, 2023
89378df
Merge branch 'master' into hduva_init_component
smilesun Aug 28, 2023
61727a3
Merge branch 'master' into hduva_init_component
smilesun Sep 1, 2023
f66ca29
Merge branch 'master' into hduva_init_component
smilesun Oct 7, 2023
a895595
Merge branch 'master' into hduva_init_component
smilesun Oct 28, 2023
27e224d
Merge branch 'master' into hduva_init_component
smilesun Nov 29, 2023
db2c8b4
Merge branch 'master' into hduva_init_component
smilesun Jan 5, 2024
bb2a5c7
Merge branch 'master' into hduva_init_component
smilesun Jan 6, 2024
e2a4f9b
Merge branch 'master' into hduva_init_component
smilesun Jan 6, 2024
6a723be
Merge branch 'master' into hduva_init_component
smilesun Jan 6, 2024
f965d00
Merge branch 'master' into hduva_init_component
smilesun Jan 6, 2024
79102c3
Merge branch 'master' into hduva_init_component
smilesun Jan 7, 2024
bd39e31
Merge branch 'master' into hduva_init_component
smilesun Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions domainlab/models/interface_vae_xyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def _init_components(self):
"""
self.add_module("encoder", self.chain_node_builder.build_encoder())
self.add_module("decoder", self.chain_node_builder.build_decoder())
self.add_module("net_p_zy",
self.chain_node_builder.construct_cond_prior(
self.dim_y, self.zy_dim))

def init_p_zx4batch(self, batch_size, device):
"""
Expand Down
22 changes: 1 addition & 21 deletions domainlab/models/model_hduva.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,30 +96,10 @@ def __init__(self, chain_node_builder,
super().__init__(chain_node_builder,
zd_dim, zy_dim, zx_dim,
list_str_y)

# topic to zd follows Gaussian distribution
self.add_module("net_p_zd",
self.chain_node_builder.construct_cond_prior(
self.topic_dim, self.zd_dim))

# override interface
def _init_components(self):
"""
q(z|x)
p(zy)
q_{classif}(zy)
"""
self.add_module("encoder", self.chain_node_builder.build_encoder(
self.device, self.topic_dim))
self.add_module("decoder", self.chain_node_builder.build_decoder(
self.topic_dim))
self.add_module("net_p_zy",
self.chain_node_builder.construct_cond_prior(
self.dim_y, self.zy_dim))
self.add_module("net_classif_y",
self.chain_node_builder.construct_classifier(
self.zy_dim, self.dim_y))
self._net_classifier = self.net_classif_y
self.topic_dim, self.zd_dim)

def init_p_topic_batch(self, batch_size, device):
"""
Expand Down
2 changes: 2 additions & 0 deletions domainlab/models/model_vae_xyd_classif.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def multiplier4task_loss(self):

def _init_components(self):
super()._init_components()
self.add_module("net_p_zy",
self.chain_node_builder.construct_cond_prior(self.dim_y, self.zy_dim))
self.add_module("net_classif_y",
self.chain_node_builder.construct_classifier(
self.zy_dim, self.dim_y))
Expand Down
Loading