-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_stats.lua
39 lines (34 loc) · 980 Bytes
/
plot_stats.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- plot_stats.lua
-- Zdeněk Janeček, 2016 ([email protected])
--
-- University of West Bohemia
require 'gnuplot'
function draw_stats(values, name)
keys = {'weight', 'vbias', 'hbias', 'weightVelocity', 'vbiasVelocity', 'hbiasVelocity'}
for _, v in pairs(keys) do
gnuplot.pngfigure('images/'..v..'-'..name..'.png')
gnuplot.raw('set yrange [0.1:*]')
--gnuplot.raw('set ytics ("0" 0.1, "1" 1, "10" 10)')
gnuplot.raw('set logscale y 2')
gnuplot.xlabel(string.format('%.6f', torch.abs(values[v]):mean()))
gnuplot.hist(values[v], 500)
gnuplot.plotflush()
end
end
function draw_sc(t, name)
gnuplot.pngfigure('images/'..name..'.png')
gnuplot.imagesc(t)
gnuplot.plotflush()
end
function draw_hist(t, name, label)
gnuplot.pngfigure('images/'..name..'.png')
gnuplot.xlabel(label)
gnuplot.ylabel('četnost')
gnuplot.hist(t)
gnuplot.plotflush()
end
function draw_plot(t, name)
gnuplot.pngfigure('images/'..name..'.png')
gnuplot.plot(t)
gnuplot.plotflush()
end