Skip to content
Snippets Groups Projects
Commit 6393276a authored by umlauf's avatar umlauf
Browse files

Case one CEL

parent 48274a65
No related branches found
No related tags found
No related merge requests found
......@@ -143,9 +143,9 @@ def train(model, name, seed,gradient_accumulation_steps,mixup, threshold, lambda
#Fkt vom Meeting
def cross_entropy(logits, target):
logprobs = torch.nn.functional.log_softmax(logits, dim = 1)
value = tensor.item()
value = target.item()
if value == 1 or value == 0:
value = tensor.item()
value = target.item()
one_hot = torch.tensor([1-value,value], device='cuda:0')
loss_clear_labels = one_hot * logprobs
return loss_clear_labels
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment