上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: pytorch中.item()方法 是得到一个元素张量里面的元素值 1 import torch 2 torch.arange(3) 1 tensor([0, 1, 2]) 1 torch.arange(3)[0].item()0 注:返回元素0. 阅读全文
posted @ 2020-12-10 21:24 vv_869 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 预训练模型是在像ImageNet这样的大型基准数据集上训练得到的神经网络模型。 现在通过Pytorch的torchvision.models 模块中现有模型如 ResNet,用一张图片去预测其类别。 1. 下载资源 这里随意从网上下载一张狗的图片。 类别标签IMAGENET1000 从 https: 阅读全文
posted @ 2020-12-10 18:38 vv_869 阅读(3464) 评论(0) 推荐(1) 编辑
摘要: 1. .pth文件 (The weights of the model have been saved in a .pth file, which is nothing but a pickle file of the model’s tensor parameters. We can load t 阅读全文
posted @ 2020-12-10 00:01 vv_869 阅读(5448) 评论(0) 推荐(0) 编辑
摘要: 1. 关于GitHub Repository: 仓库即项目 Fork: 复制克隆项目,fork后的项目独立存在 Pull Request :对fork的项目可发起请求 Watch:关注 Star:收藏 Issue:事务,可发起issue讨论 2. 关于Git Workspace:工作区 Index 阅读全文
posted @ 2020-12-09 18:35 vv_869 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 快捷键为:shift+alt+F 阅读全文
posted @ 2020-12-01 19:14 vv_869 阅读(2901) 评论(0) 推荐(0) 编辑
摘要: 1. 异或运算 2. 实现 1 # 利用Pytorch解决XOR问题 2 import torch 3 import torch.nn as nn 4 import torch.nn.functional as F 5 import torch.optim as optim 6 import num 阅读全文
posted @ 2020-11-30 20:31 vv_869 阅读(2406) 评论(0) 推荐(0) 编辑
摘要: 参考文档Module — PyTorch 1.7.0 documentation 1 @torch.no_grad() 2 def init_weights(m): 3 print(m) 4 if type(m) == nn.Linear: 5 m.weight.fill_(1.0) 6 print 阅读全文
posted @ 2020-11-30 20:23 vv_869 阅读(1862) 评论(0) 推荐(0) 编辑
摘要: 选中需要缩进的代码:ctrl+“[”键 或 ctrl+“]”键 进行左右缩进 阅读全文
posted @ 2020-11-27 21:14 vv_869 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 1. 安装,通过以下命令 1 pip install visdom 2. 启动visdom 1 python -m visdom.server 3. 启动visdom时出现了以下问题: Downloading scripts, this may take a little while 一直卡着不动, 阅读全文
posted @ 2020-11-26 21:28 vv_869 阅读(2317) 评论(0) 推荐(0) 编辑
摘要: Graphviz是一个画图工具,用图概念中的dot(节点)和edge(边)的概念来处理流程图。 PyGraphviz是Python的一个用于绘图的接口,python 对graphviz 进行了一次封装,使用pygraphviz就可以在python里面直接绘图。 相比matplotlib而言,PyGr 阅读全文
posted @ 2020-11-26 11:14 vv_869 阅读(192) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页