Skip to content

Commit

Permalink
bug re-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao committed Apr 28, 2020
1 parent 4422564 commit 5d7caa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def outlier(each_target_share_weight):
adv_loss_separate += nn.BCELoss()(domain_prob_discriminator_source_separate, torch.ones_like(domain_prob_discriminator_source_separate))
adv_loss_separate += nn.BCELoss()(domain_prob_discriminator_target_separate, torch.zeros_like(domain_prob_discriminator_target_separate))

# ============================== cross entropy loss, it receives logits as its inputs
ce = nn.CrossEntropyLoss(reduction='none')(fc2_s, label_source)
# ============================== cross entropy loss
ce = nn.CrossEntropyLoss(reduction='none')(predict_prob_source, label_source)
ce = torch.mean(ce, dim=0, keepdim=True)

with OptimizerManager(
Expand Down

0 comments on commit 5d7caa9

Please sign in to comment.