wrong histograms
See original GitHub issueHi, I am having problems plotting histograms. I think there is a very good chance that it is not because of a bug in tensorboard-pytorch, but I’m not sure what I could be doing wrong, and I’m not sure where to ask, so if someone could help I would appreciate it.
I am trying to plot histograms of the gradients like this:
loss.backward()
for n, p in filter(lambda np: np[1].grad is not None, spectral_model.named_parameters()):
print(n, p.grad.data.min(), p.grad.data.max())
summary_writer.add_histogram(n, p.grad.data.cpu().numpy(), global_step=step)
The mins and maxes show that the values are all between -.15 and .15 (and in fact most values are much closer to zero than that). But the histograms seem to show that all the values are located at one extremely high value, like 3.01e+18:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Misleading histograms - Andrey Akinshin's blog
A series of properly constructed histograms may create a false sense of security. However, one day you may try to build a histogram...
Read more >Bad "Histograms" - GeoGebra
Last updated 2/20/2020 There is something wrong with each of the "histograms" shown. Move the slider to select a new problem.
Read more >6 Reasons Why You Should Stop Using Histograms (and ...
So, What's Wrong With the Histogram? · 1. It depends (too much) on the number of bins. · 2. It depends (too much)...
Read more >How Histograms Can Misrepresent Statistical Data - dummies
The y-axis of a histogram shows how many observations are in each group, using counts or percentages. A histogram can be misleading if...
Read more >Question Video: Identifying Mistakes in a Given Histogram
... members of a cycling club over a long-distance race. David drew a histogram to represent this data. What is the mistake in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks. For now I guess I will just stick to ‘doane’ since I don’t want to hand set the binning for each parameter. Actually, I am finding the distributions tab more useful than the histograms tab for my puproses anyway (basically I am interested in monitoring spiking gradients that require clipping and maybe also gradients going to zero). We can close this issue if you want. There is definitely some buggy behavior with the default binning, but if tensorboard is doing the binning by default I guess it is probably a tensorboard issue.
Using
auto
will explode the memory (should be numpy bug). see #1 . From you last graph, I thinkbins=np.arange(-0.003, 0.003, 0.0001)
might do the work.