visdom pytorch Visualization tool
When translating this article, the torch part is omitted.
Project Address
A flexible visualization tool that can be used to create, organize, and share real-time, rich data. Support Torch and NumPy. Overview Basic Concepts Setup Launches Visual interface summary Overview
Visdom aims to promote the visualization of remote data, with a focus on supporting scientific experiments.
Send visual images, pictures, and text to you and your collaborators.
Organize your visualization space programmatically, or create dashboards for real-time data through the UI, check the results of the experiment, or debug the experimental code.
Basic Concepts
Visdom has a simple set of features that you can use to combine them into different use cases. Panes (panes)
The UI is just beginning with a whiteboard – you can fill it with images, pictures, and text. These filled data appear in Panes, where you can drag, drop, resize, and destroy the Panes. Panes are saved in Envs, and the Envs state is stored between sessions. You can download content from panes – including your drawings in SVG.
Tip: You can adjust the size of the UI by using the Zoom Out feature of your browser. environments (Environment)
You can use Envs to partition the visual space. By default, each user will have a Envs called Main. New Envs can be created programmatically or through the UI. The state of the Envs is preserved for a long time.
You can access a specific env through Url:http://localhost.com:8097/env/main.
You can access a specific env via Url:http://localhost.com:8097/env/main. If your server is hosted, then you can share this URL with other people, and others will see your visualization as well.
Management Envs:
When the server is initialized, your Envs is loaded by default via $home/.visdom/. You can also pass a custom path as a command line argument. If you remove the. json file from the Env folder, the corresponding environment is also deleted. State (status)
Once you have created some visualization, the state is saved. The server automatically caches your visualization-if you reload the page, your visualization will appear again.
Save: You can manually save the env by clicking the Save button. It serializes the Env state first, and then saves it to the hard disk as a JSON file, including the location of the window. In the same way, you can also programmatically save the env.
When faced with some very complex visualizations, such as the importance of parameter settings, this method of saving the Env state is useful. Examples: Data-rich demos, model training dashboard, or system experiments. This design still makes these visualizations very easy to share and reuse.
Fork: Have you entered a new env name, saving will build a heart env– effective forking before the state. (Note: This fork is equivalent to the fork of GitHub, similar to the meaning of replication)
Need Python 2.7/3 (and optionally Torch7)
# Install Python server and client, if you use Python, you can install this one.
pip Install Visdom
1 2 3
Start
Start the server (possibly in screen or TMUX):
Python-m Visdom.server
1
Once you start the server, you can access visdom,localhost by entering http://localhost:8097 in the browser and replacing it with your managed address.
If the above does not work, try using a SSH tunnel to your server by adding the following line to your Local~/.ssh/config :
Localforward 127.0.0.1:8097 127.0.0.1:8097. Python Example
Import visdom
import numpy as np
vis = Visdom. Visdom ()
vis.text (' Hello, world! ')
Vis.image (Np.ones (3, 10, 10))
1 2 3 4 5
Demos
Python example/demo.py
1
Visual Interface
Visdom supports the following APIs. Visual support provided by plotly. vis.scatter:2d or 3D scatter plot vis.line: line diagram Vis.stem: Stem leaf Chart vis.heatmap: Thermodynamic diagram Vis.bar: Bar vis.histogram: Histogram vis.boxplot: Box type Figure Vis.surf: Surface vis.contour: Contour map vis.quiver: Draw two-dimensional vector field vis.image: Picture vis.text: Text vis.mesh: Grid chart Vis.save: serialized state
A more detailed explanation of the above APIs will be given below. In order to have a quick understanding of Visdom's ability, you can look at example, or you can continue to look down.
The exact type of input for these APIs is different, although most API input contains a tensor X (save data) and an optional tensor Y (save tag or timestamp). All the drawing functions receive an optional argument win, which is used to bring the drawing to a specific window. Each drawing function also returns win for the current drawing. You can also specify which env to add to the diagram that is being remitted.
(the window here means "pane").
Plot.scatter
This function is a scatter chart that is used to draw 2D or 3D of data. It needs to enter the N*2 or n*3 tensor x to specify the position of N points. An alternative vector of length n is used to hold the corresponding label (1 to K) of the points in X. – The labels can be reflected by the color of the dots.
The
Scatter () supports the following options: options.colormap : Color map (Control chart color) (string; default = ' viridis ') Options.markersymbol: marker symbol (string; default = ' dot ') options.markersize : Tag Size (