domid.models package

Submodules

domid.models.a_model_cluster module

class domid.models.a_model_cluster.AModelCluster[source]

Bases: Module

Operations that all clustering models should have

__init__()[source]

Initializes internal Module state, shared by both nn.Module and ScriptModule.

create_perf_obj(task)[source]

Sets up the performance metrics used.

cal_perf_metric(loader_tr, device, loader_te=None)[source]

Clustering performance metric on the training and test/validation sets.

cal_loss(tensor_x, inj_tensor=tensor([]), warmup_beta=None)[source]

Calculates the loss for the model.

infer_d_v(x)[source]

Predict the cluster/domain of the input data. Corresponds to equation (16) in the paper.

Parameters:

x (tensor) – Input tensor of a shape [batchsize, 3, horzintal dim, vertical dim].

Return tensor preds:

One hot encoded tensor of the predicted cluster assignment.

extend(model)[source]

extend the loss of the decoratee

domid.models.model_ae module

domid.models.model_ae.mk_ae(parent_class=<class 'domid.models.a_model_cluster.AModelCluster'>)[source]
domid.models.model_ae.test_fun(d_dim, zd_dim, device)[source]

domid.models.model_dec module

domid.models.model_dec.mk_dec(parent_class=<class 'domid.models.a_model_cluster.AModelCluster'>)[source]

domid.models.model_m2yd module

domid.models.model_m2yd.mk_m2yd(parent_class=<class 'domainlab.models.a_model_classif.AModelClassif'>)[source]
domid.models.model_m2yd.test_fun()[source]

domid.models.model_sdcn module

domid.models.model_sdcn.mk_sdcn(parent_class=<class 'domid.models.a_model_cluster.AModelCluster'>)[source]

domid.models.model_vade module

domid.models.model_vade.mk_vade(parent_class=<class 'domid.models.a_model_cluster.AModelCluster'>)[source]
domid.models.model_vade.test_fun(d_dim, zd_dim, device)[source]

Module contents