aboutsummaryrefslogtreecommitdiff
path: root/tests/plots.gpi
blob: 4fd11b006d87ed3b559f2482403ae84ce5cb0ef2 (plain)
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
40
41
42
43
44
45
46
47
48
#!/usr/bin/gnuplot
set term pngcairo size 1080,720
set output 'tests/network_accuracy.png'
set multiplot layout 2, 2
set grid

json2tsv = "jq -r '.[] | [.[]] | @tsv' %s"
train_cmd = "<./ml train %s -c %s"
predict_cmd = "<./ml predict %s -c %s | ".sprintf(json2tsv, "-")

# --
data_gauss1d = "data/gauss1d.json"
data_xor = "data/xor.json"
data_sine = "data/sine.json"

# --
arch_gauss1d = "tests/architectures/gauss1d.cfg"
arch_xor = "tests/architectures/xor.cfg"
arch_sine = "tests/architectures/sine.cfg"


set ylabel arch_gauss1d
set logscale x
plot sprintf(train_cmd, data_gauss1d, arch_gauss1d) u 2:4 with lines title 'loss'
unset logscale
unset ylabel

plot sprintf(predict_cmd, data_gauss1d, arch_gauss1d) with lines title 'network',\
     "<".sprintf(json2tsv, data_gauss1d) with lines title 'original'

#set ylabel arch_xor
#set logscale x
#plot sprintf(train_cmd, data_xor, arch_xor) u 2:4 with lines title 'loss'
#unset logscale
#unset ylabel
#
#set table "/dev/stdout"
#plot "<".sprintf(json2tsv, data_xor) using 1:2:3 with table,\
#     sprintf(predict_cmd, data_xor, arch_xor)  using 3 with table

set ylabel arch_sine
set logscale x
plot sprintf(train_cmd, data_sine, arch_sine) u 2:4 with lines title 'loss'
unset logscale
unset ylabel

plot sprintf(predict_cmd, data_sine, arch_sine) with lines title 'network',\
     "<".sprintf(json2tsv, data_sine) with lines title 'original'
Feel free to download, copy and edit any repo