Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://matplotlib.org/examples/statistics/histogram_demo_multihist.html
- fig, histograms = plt.subplots(nrows=1, ncols=2)
- hist0, hist1 = histograms.flatten()
- colors = ['red', 'blue']
- hist0.hist(
- flatten_kernels[np.nonzero(flatten_kernels)],
- bin_num,
- histtype='bar',
- color=colors[0],
- label='Weights')
- hist0.set_title("Layer " + str(layer_cfg.layer_id))
- hist0.set_xlabel('Bin values')
- hist0.set_ylabel('Value occurence')
- hist1.hist(layer_cfg.bias, bin_num, histtype='bar', color=colors[1])
- hist1.set_title("Biases, layer " + str(layer_cfg.layer_id))
- hist1.set_xlabel('Bin values')
- hist1.set_ylabel('Value occurence')
- fig.tight_layout()
- plt.grid(True)
- plt.show()
- # n, bins, patches = plt.hist(
- # flatten_kernels[np.nonzero(flatten_kernels)],
- # bin_num,
- # facecolor='green',
- # label='Weights',
- # alpha=0.75)
- # n, bins, patches = plt.hist(
- # layer_cfg.bias, bin_num, facecolor='blue', label='Biases', alpha=0.75)
- # plt.xlabel('Bins')
- # plt.ylabel('Max value occurence')
- # plt.title("Layer " + str(layer_cfg.layer_id))
- # plt.grid(True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement