New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weight problem #16
Comments
@litongxin666 I re-config the weight in train_deepmar_resnet50.py, line 344-352 |
Hello, @dangweili ,Thanks to the great codebase! I has some confusions as follow: In train_deepmar_resnet50.py, line 355: In evaluate.py, line 45-46: In demo.py, line 129, 137: |
criterion = F.binary_cross_entropy_with_logits |
What I am confused about is why the label is set to -1 when the data set is loaded. |
Of course, 0 and -1 do not matter. |
weights = torch.zeros(targets_var.shape)
for i in range(targets_var.shape[0]):
for j in range(targets_var.shape[1]):
if targets_var.data.cpu()[i, j] == -1:
weights[i, j] = weight_neg[j]
elif targets_var.data.cpu()[i, j] == 1:
if targets_var.data.cpu()[i, j] == -1: should be changed to targets_var.data.cpu()[i, j] == 0
The text was updated successfully, but these errors were encountered: