当前位置:网站首页>Pytoch (IV) -- visual tool visdom
Pytoch (IV) -- visual tool visdom
2022-07-01 04:46:00 【CyrusMay】
Pytorch( Four ) —— Visualization tools Visdom
1. install
pip install visdom
2 Usage flow
2.1 Turn on visdom Of web The server
python -m visdom.server
2.2 Visual categories and related parameters
2.2.1 Curve Visualization
from visdom import Visdom
vis = Visdom()
vis.line(Y=[[0,0]],
X=[0],
win=" This is a small window title",
env=" This is for the big window title", # The default is main
opts=dict(title="change_x_y",legend=["x","y"]) # You can set the graphic title and title
) # Initialize the curve
vis.line([[Tensor.item()],
[Tensor.item()],
win="change_X",
update="append") # Append curve data
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 Picture Visualization
from visdom import Visdom
vis = Visdom()
vis.image(img=data.view(-1,1,28,28),
win=" This is a small window title",
env=" This is for the big window title", # The default is main
) # Initialize the curve
2.2.3 Text visualization
from visdom import Visdom
vis = Visdom()
vis.text(text=str(Tensor.cpu().numpy()),
win=" This is a small window title",
env=" This is for the big window title", # The default is main
) # Initialize the curve
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=" Text display ",env="main")

by CyrusMay 2022 06 29
Most profound The story of Most eternal The legend of
however It's you Is my can Ordinary life
—————— May day ( Because of you So I )——————
边栏推荐
- 科研狗可能需要的一些工具
- 神经网络的基本骨架-nn.Moudle的使用
- 无器械健身
- Take a cold bath
- CF1638E. Colorful operations Kodori tree + differential tree array
- Shell之分析服务器日志命令集锦
- Tencent has five years of testing experience. It came to the interview to ask for 30K, and saw the so-called software testing ceiling
- 分布式数据库数据一致性的原理、与技术实现方案
- 神经网络-最大池化的使用
- Summary of acl2021 information extraction related papers
猜你喜欢

Software testing needs more and more talents. Why do you still not want to take this path?

STM32扩展版 按键扫描

2022 Shanghai safety officer C certificate examination question simulation examination question bank and answers

Fitness without equipment
![AssertionError assert I.ndim == 4 and I.shape[1] == 3](/img/b1/0109bb0f893eb4c8915df36c100907.png)
AssertionError assert I.ndim == 4 and I.shape[1] == 3

神经网络-非线性激活

2022 question bank and answers for safety production management personnel of hazardous chemical production units
![AssertionError assert I.ndim == 4 and I.shape[1] == 3](/img/b1/0109bb0f893eb4c8915df36c100907.png)
AssertionError assert I.ndim == 4 and I.shape[1] == 3

Ten wastes of software research and development: the other side of research and development efficiency

技术分享| 融合调度中的广播功能设计
随机推荐
LeetCode_35(搜索插入位置)
LeetCode_ 53 (maximum subarray and)
AssertionError assert I.ndim == 4 and I.shape[1] == 3
Difficulties in the development of knowledge map & the importance of building industry knowledge map
Pytorch(一) —— 基本语法
VR线上展览所具备应用及特色
The index is invalid
科研狗可能需要的一些工具
C - detailed explanation of operators and summary of use cases
解决:拖动xib控件到代码文件中,报错setValue:forUndefinedKey:this class is not key value coding-compliant for the key
How to do the performance pressure test of "Health Code"
总结全了,低代码还需要解决这4点问题
分布式-总结列表
Strategic suggestions and future development trend of global and Chinese vibration isolator market investment report 2022 Edition
无器械健身
Odeint and GPU
Matters behind the construction of paint testing laboratory
2022 hoisting machinery command registration examination and hoisting machinery command examination registration
最长递增子序列及最优解、动物总重量问题
This sideline workload is small, 10-15k, free unlimited massage