domainlab.algos.trainers.compos package

Submodules

domainlab.algos.trainers.compos.matchdg_args module

args for matchdg

domainlab.algos.trainers.compos.matchdg_args.add_args2parser_matchdg(parser)[source]

args for matchdg

domainlab.algos.trainers.compos.matchdg_match module

class domainlab.algos.trainers.compos.matchdg_match.MatchPair(dim_y, i_c, i_h, i_w, bs_match, virtual_ref_dset_size, num_domains_tr, list_tr_domain_size)[source]

Bases: object

match different input

domainlab.algos.trainers.compos.matchdg_utils module

create dictionary for matching

class domainlab.algos.trainers.compos.matchdg_utils.MatchDictInit(keys, vals, i_c, i_h, i_w)[source]

Bases: object

base class for matching dictionary creator

get_num_rows(key)[source]
class domainlab.algos.trainers.compos.matchdg_utils.MatchDictNumDomain2SizeDomain(num_domains_tr, list_tr_domain_size, i_c, i_h, i_w)[source]

Bases: MatchDictInit

tensor dimension for the kth domain: [num_domains_tr, (size_domain_k, i_c, i_h, i_w)]

get_num_rows(key)[source]
class domainlab.algos.trainers.compos.matchdg_utils.MatchDictVirtualRefDset2EachDomain(virtual_ref_dset_size, num_domains_tr, i_c, i_h, i_w)[source]

Bases: MatchDictInit

dict[0:virtual_ref_dset_size] has tensor dimension: (num_domains_tr, i_c, i_h, i_w)

get_num_rows(key=None)[source]

key is 0:virtual_ref_dset_size

domainlab.algos.trainers.compos.matchdg_utils.dist_cosine_agg(x1, x2)[source]

torch.nn.CosineSimilarity assumes x1 and x2 share exactly the same dimension

domainlab.algos.trainers.compos.matchdg_utils.dist_pairwise_cosine(x1, x2, tau=0.05)[source]

x1 and x2 does not necesarilly have the same shape, and we want to have a cartesian product of the pairwise distances

domainlab.algos.trainers.compos.matchdg_utils.fun_tensor_normalize(tensor_batch_x)[source]
domainlab.algos.trainers.compos.matchdg_utils.get_base_domain_size4match_dg(task)[source]

Base domain is a dataset where each class set come from one of the nominal domains

Module contents