当前位置:网站首页>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 )——————
边栏推荐
- Pytorch(四) —— 可视化工具 Visdom
- STM32扩展板 数码管显示
- Basic usage, principle and details of session
- LeetCode_ 28 (implement strstr())
- 2022 a special equipment related management (elevator) simulation test and a special equipment related management (elevator) certificate examination
- Common methods in transforms
- 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
- Measurement of quadrature axis and direct axis inductance of three-phase permanent magnet synchronous motor
- 解决:Thread 1:[<*>setValue:forUndefinedKey]:this class is not key value coding-compliant for the key *
- pytorch中常用数据集的使用方法
猜你喜欢

How to do the performance pressure test of "Health Code"

The index is invalid

CF1638E. Colorful operations Kodori tree + differential tree array

最长递增子序列及最优解、动物总重量问题

How to use maixll dock

2022 hoisting machinery command registration examination and hoisting machinery command examination registration
![[godot] unity's animator is different from Godot's animplayer](/img/51/48f40a7b6736d7f78040eabbbd3395.jpg)
[godot] unity's animator is different from Godot's animplayer

2022 tea master (intermediate) examination question bank and tea master (intermediate) examination questions and analysis

2022 polymerization process test questions and simulation test

About the transmission pipeline of stage in spark
随机推荐
2022 tea master (intermediate) examination question bank and tea master (intermediate) examination questions and analysis
Basic skeleton of neural network nn Use of moudle
Software testing needs more and more talents. Why do you still not want to take this path?
Pytorch convolution operation
Common interview questions ①
JS to solve the problem of floating point multiplication precision loss
One click shell to automatically deploy any version of redis
Codeforces Round #771 (Div. 2) ABCD|E
分布式事务-解决方案
Sorting out 49 reports of knowledge map industry conference | AI sees the future with wisdom
JS rotation chart
Dede collection plug-in does not need to write rules
LM小型可编程控制器软件(基于CoDeSys)笔记十九:报错does not match the profile of the target
Shell之Unix运维常用命令
Why is Internet thinking not suitable for AI products?
RuntimeError: “max_pool2d“ not implemented for ‘Long‘
Basic usage, principle and details of session
Advanced application of ES6 modular and asynchronous programming
RuntimeError: mean(): input dtype should be either floating point or complex dtypes.Got Long instead
Odeint et GPU