说明:在PyTorch中可以方便的验证SoftMax交叉熵损失和对输入梯度的计算
关于softmax_cross_entropy求导的过程,可以参考HERE
示例:
# -*- coding: utf-8 -*-
import torch
import torch.autograd as autograd
from torch.autograd import Variable
import torch.nn.functional as F
import torch.nn as nn
import n <weixin_38636763> 上传 | 大小:47kb