摘要: 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.sof 阅读全文
posted @ 2018-10-29 00:04 沙潇 阅读(1631) 评论(0) 推荐(0)
摘要: 1. 引入 import torch import torch.nn as nn 2. 一个线性层 mod= nn.Linear(5,3,bias = True) # input 是5 output 是3 3. 大小为5的随机tensor x = torch.rand(5) print (x.siz 阅读全文
posted @ 2018-10-28 23:00 沙潇 阅读(332) 评论(0) 推荐(0)