当前位置:网站首页>Pytorch(四) —— 可视化工具 Visdom
Pytorch(四) —— 可视化工具 Visdom
2022-07-01 04:35:00 【CyrusMay】
Pytorch(四) —— 可视化工具 Visdom
1.安装
pip install visdom
2 使用流程
2.1 开启visdom的web服务器
python -m visdom.server
2.2 可视化种类及相关参数
2.2.1 曲线可视化
from visdom import Visdom
vis = Visdom()
vis.line(Y=[[0,0]],
X=[0],
win="这是小窗口的title",
env="这是大窗口的title", # 默认为main
opts=dict(title="change_x_y",legend=["x","y"]) # 可以设置图形标题和title
) # 初始化曲线
vis.line([[Tensor.item()],
[Tensor.item()],
win="change_X",
update="append") # 追加曲线数据
from visdom import Visdom
import torch
from torch import nn
import torch.nn.functional as F
vis = Visdom()
vis.line(Y=[[0,0]],X=[0],win="change_X",env="main",opts=dict(title="change_x_y",legend=["x","y"]))
def f(x):
return x[0]**2 + x[1]**2
x = torch.tensor([100.,90.],requires_grad=True)
opt = torch.optim.Adam([x],lr = 0.1)
epochs = 1000
for i in range(epochs):
y = f(x)
opt.zero_grad()
y.backward()
opt.step()
vis.line([[x[0].item(),x[1].item()]],[i],win="change_X",update="append")

2.2.2 图片可视化
from visdom import Visdom
vis = Visdom()
vis.image(img=data.view(-1,1,28,28),
win="这是小窗口的title",
env="这是大窗口的title", # 默认为main
) # 初始化曲线
2.2.3 文字可视化
from visdom import Visdom
vis = Visdom()
vis.text(text=str(Tensor.cpu().numpy()),
win="这是小窗口的title",
env="这是大窗口的title", # 默认为main
) # 初始化曲线
from visdom import Visdom
import torch
from torch import nn
import torch.nn.functional as F
vis = Visdom()
label = torch.arange(100)
vis.text(str(label.cpu().numpy()),win="文字展示",env="main")

by CyrusMay 2022 06 29
最深刻 的故事 最永恒 的传说
不过 是你 是我 能够 平凡生活
——————五月天(因为你 所以我)——————
边栏推荐
- Tcp/ip explanation (version 2) notes / 3 link layer / 3.4 bridge and switch / 3.4.2 multiple registration protocol (MRP)
- Embedded System Development Notes 80: using QT designer to design the main interface
- Programs and processes, process management, foreground and background processes
- Extension fragment
- Shell之一键自动部署Redis任意版本
- Knowledge supplement: redis' basic data types and corresponding commands
- 如何看待智慧城市建设中的改变和机遇?
- The junior college students were angry for 32 days, four rounds of interviews, five hours of soul torture, and won Ali's offer with tears
- Offline installation of Wireshark 2.6.10
- Haskell lightweight threads overhead and use on multicores
猜你喜欢

Maixll-Dock 快速上手

2022 t elevator repair new version test questions and t elevator repair simulation test question bank

使用WinMTR软件简单分析跟踪检测网络路由情况

MySQL advanced -- you will have a new understanding of MySQL

Extension fragment

slf4j 简单实现

2022年T电梯修理题库及模拟考试

Common thread methods and daemon threads
![[human version] Web3 privacy game in the dark forest](/img/89/e16789b7f3892002748aab309c45e6.png)
[human version] Web3 privacy game in the dark forest

OdeInt与GPU
随机推荐
Daily algorithm & interview questions, 28 days of special training in large factories - the 13th day (array)
2022 gas examination question bank and online simulation examination
2022 tea master (intermediate) examination question bank and tea master (intermediate) examination questions and analysis
One job hopping up 8K, three times in five years
2022 a special equipment related management (elevator) simulation test and a special equipment related management (elevator) certificate examination
Caijing 365 stock internal reference | the first IPO of Beijing stock exchange; the subsidiary of the recommended securities firm for gambling and gambling, with a 40% discount
Learn Chapter 20 of vue3 (keep alive cache component)
【深度学习】(4) Transformer 中的 Decoder 机制,附Pytorch完整代码
Collect the annual summary of laws, regulations, policies and plans related to trusted computing of large market points (national, ministerial, provincial and municipal)
[recommended algorithm] C interview question of a small factory
软件研发的十大浪费:研发效能的另一面
MySQL winter vacation self-study 2022 12 (5)
Grey correlation cases and codes
283. move zero
Advanced application of ES6 modular and asynchronous programming
做网站数据采集,怎么选择合适的服务器呢?
Odeint et GPU
PgSQL failed to start after installation
Maixll-Dock 使用方法
尺取法:有效三角形的个数