# How to create histogram for all the feature maps of a CNN convolution layer

**URL:** <https://discuss.pytorch.org/t/how-to-create-histogram-for-all-the-feature-maps-of-a-cnn-convolution-layer/99673>\
**Category:** vision\
**Created:** [October 17, 2020, 1:54am UTC](https://discuss.pytorch.org/t/how-to-create-histogram-for-all-the-feature-maps-of-a-cnn-convolution-layer/99673 "2020-10-17T01:54:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Borhan](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/b/ba8739/32.png) [@Borhan](https://discuss.pytorch.org/u/Borhan)\
**Post date:** [October 17, 2020, 1:54am UTC](https://discuss.pytorch.org/t/how-to-create-histogram-for-all-the-feature-maps-of-a-cnn-convolution-layer/99673/1 "2020-10-17T01:54:44Z")

</div>

Let’s say I have a pretrained model (e.g Alexnet). I want to generate a histogram for all the feature maps from a convolution layer ( say 64 feature maps for convo layer 1) such that each feature map become a bin of the histogram ( In this case 64 bins). Any idea how to do that?

---

<div class="post-metadata">

**Author:** ![a\_d](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@a\_d](https://discuss.pytorch.org/u/a_d)\
**Post date:** [October 17, 2020, 2:46am UTC](https://discuss.pytorch.org/t/how-to-create-histogram-for-all-the-feature-maps-of-a-cnn-convolution-layer/99673/2 "2020-10-17T02:46:36Z")

</div>

This thread might help you - [here](https://discuss.pytorch.org/t/visualize-feature-map/29597/7)
