Metric learning
一:减小类内距离,增大类间距离
class Metric_loss(nn.Module):
def __init__(self,src_class):
super(Metric_loss, self).__init__()
self.n_class=src_class
def forward(self, s_feature,s_labels):
n, d = s_feature.shape
# get labels
原创
2021-10-26 16:58:12 ·
526 阅读 ·
1 评论