当前位置:网站首页>How to use tensorboard add_ histogram
How to use tensorboard add_ histogram
2022-06-22 02:27:00 【Melody2050】
Code samples https://pytorch.org/docs/stable/tensorboard.html
Run the following code
from torch.utils.tensorboard import SummaryWriter
import numpy as np
# Code sample from https://pytorch.org/docs/stable/tensorboard.html
writer = SummaryWriter(log_dir="add_histogram_demo_data/log")
for i in range(10):
x = np.random.random(1000)
writer.add_histogram('distribution centers', x + i, i)
writer.close()
And in add_histogram_demo_data Run in directory , open tensorboard
tensorboard --logdir="./log"
You can see the results as shown in the figure , The distribution of all the data is shown in the figure , So how to understand this histogram ?
We look at the first data block , It represents writer.add_histogram('distribution centers', x + i, 0) Call to , here global_step=0. identical global_step The data will be placed on the same layer .
The height of the block pointed to in the above figure is 336, Abscissa for 0.167, Ordinate for 0, This represents the second 0 Layer data in 0.167 There are some nearby points 336 individual .
Let's take a screenshot of the distribution of the other two points on this layer , The heights are respectively 324 and 340.336+324+340=1000, It's about x = np.random.random(1000) Corresponding to the . This is what the histogram shows 1000 Numerical distribution of points .

Of course , The data are certainly not all exactly equal to 0.167,0.500 and 0.833, They just happen to be located near these ,debug See the specific data .
边栏推荐
- Transformation numérique des RH avec okr
- 微信小程序影视评论交流平台系统毕业设计毕设(2)小程序功能
- Brief introduction to common pigtails of communication pigtails
- New employees enter the company and learn about work information
- 使用 OKR 进行 HR 数字化转型
- [essay] the Expo that studied the RN ecology for one day yesterday is really awesome. It works well from development and construction to deployment.
- pdf转word pdf转图片 图片转pdf 修改pdf文件就像操作Word一样方便(Acrobat DC使用介绍)
- 快速学会CAD绘制传输线路图纸
- FPGA Xilinx 7 Series FPGA DDR3 hardware design rules
- FB programming under botu PLC and CoDeSys platform (how to realize 100 channel FB cycle traversal execution)
猜你喜欢

Games-101 personal summary rasterization

A short video costs hundreds of thousands of yuan, and the virtual digital man makes a circle with "strength"

1277_ Implementation analysis of vtaskdelay in FreeRTOS

Creating and extending XFS file system based on LVM

基于xposed框架hook使用

Atguigu---- list rendering

Rely on the robustness of trusted AI to effectively identify deep forgery and help banks fight identity fraud

Using hook based on xposed framework

Wechat applet film and television review and exchange platform system graduation design (1) development outline

Leetcode 41 - 45 dynamic planning topic
随机推荐
Error reporting and table layout of latex on &
With the acceleration of industry wide digital transformation, what kind of storage will be more popular?
Fabric. JS iText set italics manually
PostgreSQL fetches data according to the size of the time field
EMC整改小技巧
C # judge whether the application is started and displayed
快速学会CAD绘制传输线路图纸
软件测试工程师面试接口测试常见问题
Chrome browser cancel input box to record form input history
Wechat applet film and television comment exchange platform system graduation design (2) applet function
FPGA-Xilinx 7系列FPGA DDR3硬件设计规则
Array common methods
An error occurs when Android uses the SQL database to login. Attempt to invoke virtual method '' on a null object reference
使用 OKR 進行 HR 數字化轉型
Rely on the robustness of trusted AI to effectively identify deep forgery and help banks fight identity fraud
Linxu modify the permissions of the folder so that everyone can access 777
Wechat applet Film & TV Review Exchange Platform System Graduation Design (4) Rapport d'ouverture
LeetCode 513 找树左下角的值[BFS 二叉树] HERODING的LeetCode之路
Asemi fast recovery diode FR107 parameter, FR107 real object, FR107 application
Cmake common command category notes