def __init__(self): super(ImgTextCompositionBase, self).__init__() self.normalization_layer = torch_functions.NormalizationLayer( normalize_scale=4.0, learn_scale=True) self.soft_triplet_loss = torch_functions.TripletLoss()
def __init__(self): super(ImgTextCompositionBase, self).__init__() self.soft_triplet_loss = torch_functions.TripletLoss() self.loss_weight = 10.0 self.loss_weight = torch.nn.Parameter( torch.FloatTensor((self.loss_weight, )))