edited body
nbro
• 31.2k
• 8
• 65
• 130

I want to train a neural network model with the arcface loss function and try to combine it with domain adaption. But when the traintraining process continues, I find the test accuracy first increases and then decreases,the the model cannot reach convergence. I I chose the office31 dataset,and and the feature_extractor was resnet50.

I want to know if it is caused by my code,or or by my loss function

theThe arcface function was set as

def Arc_pred(cosine, s=64.0, m=0.1):
cosine = cosine / s
thea = torch.acos(cosine)
top = torch.exp(torch.cos(thea + m) * s)
_top = torch.exp(torch.cos(thea) * s)
bottom = torch.sum(torch.exp(cosine * s), dim=1).view(-1, 1)
divide = (top / (bottom - _top + top)) + 1e-10
return divide


and my total loss function was set as

        total_loss = 0.1*target_entropy_loss + label_loss + arc_loss + discriminator_loss


In that,the the target_entropy_loss tries to make the decision boundary cross the The sparsest sample area，  label_loss was the classification loss,  discriminator_loss was a domain adaptation loss function.

I tried to set a learning rate schedule for my experiment,it it seems it did not work. So, could it be caused by my loss function?

Re-tag and fix grammar
mugoh
• 507
• 2
• 18

# test accruacy decrease Test accuracy decreases during my train process

I

I want to train ana neural network model with the arcface loss function and try to combine it with the domain adaption. But when the train process continuecontinues, iI find the test accuracy increase firsrfirst increases and then decreasedecreases,the model cannot reach an convergence. I choosechose the office31 dataset,and the feature_extractor was resnet50.I I want to know if it caused by my code,or by my loss function

the arcface function was set as

def Arc_pred(cosine, s=64.0, m=0.1):
cosine = cosine / s
thea = torch.acos(cosine)
top = torch.exp(torch.cos(thea + m) * s)
_top = torch.exp(torch.cos(thea) * s)
bottom = torch.sum(torch.exp(cosine * s), dim=1).view(-1, 1)
divide = (top / (bottom - _top + top)) + 1e-10
return divide


and my total loss function was set as

        total_loss = 0.1*target_entropy_loss + label_loss + arc_loss + discriminator_loss


In that,the target_entropy_loss trytarget_entropy_loss tries to make the decision boundary cross the The sparsest sample area， label losslabel_loss was the classification loss,discriminator_lossdiscriminator_loss was a domain adaptation loss function.

I trytried to set a learning rate schedule for my experiment,it seems it did not workswork.So So could it be caused by my loss function?

# test accruacy decrease during my train process

I want to train an neural network model with the arcface loss function and try to combine it with the domain adaption. But when the train process continue, i find the test accuracy increase firsr and then decrease,the model cannot reach an convergence. I choose the office31 dataset,and the feature_extractor was resnet50.I want to know if it caused by my code,or by my loss function

the arcface function was set as

def Arc_pred(cosine, s=64.0, m=0.1):
cosine = cosine / s
thea = torch.acos(cosine)
top = torch.exp(torch.cos(thea + m) * s)
_top = torch.exp(torch.cos(thea) * s)
bottom = torch.sum(torch.exp(cosine * s), dim=1).view(-1, 1)
divide = (top / (bottom - _top + top)) + 1e-10
return divide


and my total loss function was set as

        total_loss = 0.1*target_entropy_loss + label_loss + arc_loss + discriminator_loss


In that,the target_entropy_loss try to make the decision boundary cross the The sparsest sample area， label loss was the classification loss,discriminator_loss was a domain adaptation loss function.

I try to set a learning rate schedule for my experiment,it seems did not works.So could it caused by my loss function?