Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

multiple loss pytorch

b = nn.MSELoss()
a = nn.CrossEntropyLoss()

loss_a = a(output_x, x_labels)
loss_b = b(output_y, y_labels)

loss = loss_a + loss_b

loss.backward()
Source by discuss.pytorch.org #
 
PREVIOUS NEXT
Tagged: #multiple #loss #pytorch
ADD COMMENT
Topic
Name
4+9 =