
日常个人跑代码小记录
被窝少女社会历险记
正在入门机器学习,深度学习的百香果儿味小白菜
展开
-
torch.argmax( ,dim=1)
**torch.argmax()**维度本身就很难理解,作为一名小白,这篇用来给同样有维度困扰的你们,里面的例子引用了:https://blog.youkuaiyun.com/weixin_43869268/article/details/107624108x = torch.randn(2,4,5)print(x)> tensor([[[-0.2377, -1.0894, 1.7376, -1.7329, 0.4314], [-1.4899, -0.7765, -0.8258原创 2021-04-08 11:41:19 · 5519 阅读 · 6 评论 -
.shape()与.reshape()函数
.shape()和.reshape()函数 .shape()函数如下代码所示, .shape()函数显示出x是2行5列的数组。import numpy as npx = np.array([[1,2,3,4,5], [6,7,8,9,10]])#pycharm输出命令print(x.shape)#结果(2, 5).reshape()函数当reshape(-1):x.reshape(-1)print(x.reshape(-1))#输出原创 2020-12-09 18:16:40 · 4359 阅读 · 0 评论