首页 > 其他 > 详细

softmax

时间:2018-10-29 01:53:35      阅读:197      评论:0      收藏:0      [点我收藏+]

import torch

import torch.nn.functional as F

x1= torch.Tensor( [ [1,2,3,4],[1,3,4,5],[3,4,5,6]])

y11= F.softmax(x, dim = 0) #对每一列进行softmax

y12 = F.softmax(x,dim =1) #对每一行进行softmax

x2 = torch.Tensor([1,2,3,4])

y2 = F.softmax(x2,dim=0)

 

softmax

原文:https://www.cnblogs.com/shaxiaoshaxiao/p/9868057.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!