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)
這里的dim=0其實就是張量的0軸,dim=1就是張量的1軸。
\(J_\alpha(x)=\)