当前位置:网站首页>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 )——————
边栏推荐
- LeetCode_ 58 (length of last word)
- Difficulties in the development of knowledge map & the importance of building industry knowledge map
- Quelques outils dont les chiens scientifiques pourraient avoir besoin
- 科研狗可能需要的一些工具
- LeetCode_35(搜索插入位置)
- Basic skeleton of neural network nn Use of moudle
- [pat (basic level) practice] - [simple simulation] 1064 friends
- 2022.2.7-2.13 AI industry weekly (issue 84): family responsibilities
- Shell之一键自动部署Redis任意版本
- 【FTP】FTP常用命令,持续更新中……
猜你喜欢

Why is Internet thinking not suitable for AI products?

2022 G2 power station boiler stoker examination question bank and G2 power station boiler stoker simulation examination question bank

神经网络-非线性激活

Execution failed for task ‘:app:processDebugResources‘. > A failure occurred while executing com. and

Strategic suggestions and future development trend of global and Chinese vibration isolator market investment report 2022 Edition

Pytorch convolution operation

Odeint et GPU

VIM简易使用教程

The design points of voice dialogue system and the importance of multi round dialogue

Basic skeleton of neural network nn Use of moudle
随机推荐
JS rotation chart
Tencent has five years of testing experience. It came to the interview to ask for 30K, and saw the so-called software testing ceiling
LeetCode_53(最大子数组和)
[difficult] sqlserver2008r2, can you recover only some files when recovering the database?
LeetCode_28(实现 strStr())
LeetCode_66(加一)
Neural network convolution layer
Maixll dock quick start
神经网络-非线性激活
RuntimeError: mean(): input dtype should be either floating point or complex dtypes. Got Long instead
Pytorch convolution operation
VIM easy to use tutorial
Leecode records the number of good segmentation of 1525 strings
扩展-Fragment
分布式架构系统拆分原则、需求、微服务拆分步骤
神经网络的基本骨架-nn.Moudle的使用
Some tools that research dogs may need
JVM栈和堆简介
Construction of Meizhou nursing laboratory: equipment configuration
手动实现一个简单的栈