def __init__(self): super(DANNModel, self).__init__() self.features, self.pooling, self.class_classifier, \ pooling_ftrs, pooling_output_side = backbone_models.get_backbone_model() self.domain_classifier = nn.Sequential( nn.Linear(pooling_ftrs * pooling_output_side * pooling_output_side, 128), nn.BatchNorm1d(128), nn.ReLU(), nn.Linear(128, 1), )
def __init__(self): super(DANNModel, self).__init__() self.features, self.pooling, self.class_classifier, \ domain_input_len, self.classifier_before_domain_cnt = backbone_models.get_backbone_model() self.domain_classifier = nn.Sequential( nn.Linear(domain_input_len, 1024), nn.BatchNorm1d(1024), nn.ReLU(), nn.Linear(1024, 1024), nn.BatchNorm1d(1024), nn.ReLU(), nn.Linear(1024, 1), )
def __init__(self): super(DANNModel, self).__init__() self.features, self.pooling, self.class_classifier, \ domain_input_len, self.classifier_before_domain_cnt = backbone_models.get_backbone_model() if dann_config.NEED_ADAPTATION_BLOCK: self.adaptation_block = nn.Sequential( nn.ReLU(), nn.Linear(domain_input_len, 2048), nn.ReLU(inplace=True), ) domain_input_len = 2048 classifier_start_output_len = self.class_classifier[self.classifier_before_domain_cnt][-1].out_features self.class_classifier[self.classifier_before_domain_cnt][-1] = nn.Linear(2048, classifier_start_output_len) self.domain_classifier = domain_heads.get_domain_head(domain_input_len)
def __init__(self): super(OneDomainModel, self).__init__() self.features, self.pooling, self.class_classifier, *_ = backbone_models.get_backbone_model( )
def __init__(self): super(DANNModel, self).__init__() self.features, self.pooling, self.class_classifier, \ domain_input_len, self.classifier_before_domain_cnt = backbone_models.get_backbone_model() self.domain_classifier = domain_heads.get_domain_head(domain_input_len)
def __init__(self): super(DANNCA_Model, self).__init__() self.features, self.pooling, self.class_classifier, \ _, _ = backbone_models.get_backbone_model()