Pytorch Loss function 정리

Pytorch Loss function 정리

2020, Oct 15    


Pytorch 관련 글 목차



Drawing



목차


  • Negative Log Likelihood Loss


Negative Log Likelihood Loss



import torch.nn as nn
import nn.functional as F

loss = nn.NLLLoss(weight)
# output shape : (Batch Size, C, d1, d2, ...)
loss(F.log_softmax(output, 1), targets)


Pytorch 관련 글 목차