Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

what is cross entropy loss in pytorch example

>>> loss = nn.CrossEntropyLoss()
>>> input = torch.randn(3, 5, requires_grad=True)
>>> target = torch.empty(3, dtype=torch.long).random_(5)
>>> output = loss(input, target)
>>> output.backward()
Source by pytorch.org #
 
PREVIOUS NEXT
Tagged: #cross #entropy #loss #pytorch
ADD COMMENT
Topic
Name
1+6 =