megvii-research / FQ-ViT

[IJCAI 2022] FQ-ViT: Post-Training Quantization for Fully Quantized Vision Transformer
Apache License 2.0
301 stars 48 forks source link

How to visualize the Figure3? #28

Closed YoloEliwa closed 1 year ago

YoloEliwa commented 1 year ago

Hello, Thanks for this amazing work! I want to know how to obtain distribution like Figure3. Can you share the visualization code with me? I am looking forward to your reply!

PeiqinSun commented 1 year ago

1, get the attention-map outputs of some samples 2, draw data bins(i.e. 2048 bins) in figure use the pyplot

YoloEliwa commented 1 year ago

Thanks for your reply! I want to know how to set the x-axis like Figure3?And, how many samples you used?

linyang-zhh commented 1 year ago

Thanks for your reply! I want to know how to set the x-axis like Figure3?And, how many samples you used?

  1. use matplotlib with plt.xscale('log')
  2. We use 100 random samples on ImageNet and we believe that the number of samples has little influence on that distribution.