MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / plot_his

Function plot_his

tensorflowTUT/tf23_BN/tf23_BN.py:29–50  ·  view source on GitHub ↗
(inputs, inputs_norm)

Source from the content-addressed store, hash-verified

27
28
29def plot_his(inputs, inputs_norm):
30 # plot histogram for the inputs of every layer
31 for j, all_inputs in enumerate([inputs, inputs_norm]):
32 for i, input in enumerate(all_inputs):
33 plt.subplot(2, len(all_inputs), j*len(all_inputs)+(i+1))
34 plt.cla()
35 if i == 0:
36 the_range = (-7, 10)
37 else:
38 the_range = (-1, 1)
39 plt.hist(input.ravel(), bins=15, range=the_range, color='#FF5733')
40 plt.yticks(())
41 if j == 1:
42 plt.xticks(the_range)
43 else:
44 plt.xticks(())
45 ax = plt.gca()
46 ax.spines['right'].set_color('none')
47 ax.spines['top'].set_color('none')
48 plt.title("%s normalizing" % ("Without" if j == 0 else "With"))
49 plt.draw()
50 plt.pause(0.01)
51
52
53def built_net(xs, ys, norm):

Callers 1

tf23_BN.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected