当前位置:网站首页>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 .
边栏推荐
- Technical exploration: 360 digital subjects won the first place in the world in ICDAR OCR competition
- 软件测试工程师面试接口测试常见问题
- Ioerror: no translation files found for default language zh cn Solutions for
- 微信小程序影視評論交流平臺系統畢業設計畢設(4)開題報告
- [Chapter 26 medical impact segmentation system based on minimum error method and region growth -- matlab deep learning practical GUI project]
- What does informer have
- GoLand启动时闪退
- 2022 brazing test simulation 100 questions and answers
- Chapter 19 signal lamp image simulation control technology based on speech recognition
- idea----bookmark
猜你喜欢

Wechat applet film and television comment exchange platform system graduation design completion (6) opening defense ppt

MATLAB 学习笔记(5)MATLAB 数据的导入和导出

Matlab learning notes (5) import and export of MATLAB data

excel常用快捷键excel快捷键汇总

Asemi Schottky diode 1N5819 parameters, 1N5819 replacement, 1N5819 source

Sword finger offer 26: substructure of tree

idea----bookmark

Object detection -- how to use labelimg annotation tool
![[Chapter 20 video target detection based on inter frame difference method -- Application of MATLAB software in-depth learning]](/img/40/0d2d4c74b4b2cc2292450d9940e998.png)
[Chapter 20 video target detection based on inter frame difference method -- Application of MATLAB software in-depth learning]

快速学会CAD绘制传输线路图纸
随机推荐
快速学会CAD绘制传输线路图纸
理财产品赎回确认日是什么意思?
Zap grammar sugar
LeetCode 513 找树左下角的值[BFS 二叉树] HERODING的LeetCode之路
Input系统学习-----InputFilter
[phantom engine UE] package error appears! Solutions to findpin errors
[proteus simulation] INT0 and INT1 interrupt count
EMC radiation emission rectification - principle case analysis
Games-101-personal summary shading
微信小程序影视评论交流平台系统毕业设计毕设(3)后台功能
Get to know unity3d (project structure, third-party plug-in of probuilder)
MySQL recursively finds the tree structure. This method is very practical!
Matlab learning notes (4) matlab array
微信小程序影視評論交流平臺系統畢業設計畢設(4)開題報告
Return to Chengdu to start my software testing career
What does informer have
Chapter 18 build a general video processing tool based on GUI matlab application GUI implementation
Idea ---- copy and paste
Games-101 personal summary rasterization
Minecraft 1.18.2 生化8 模组 1.3版本 物品3D化+更加复杂村庄