Skip to content

Commit

Permalink
Using weights (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
moraygrieve authored Jan 21, 2025
1 parent 5e23f18 commit 5c4c0c8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
18 changes: 9 additions & 9 deletions admin/graph_performance/Input/gnuplot_pg1.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ set multiplot layout 3,3 title ARG2." (page 1): ".ARG1 noenhanced scale 0.95,0.9

@Y1MARGIN; @X1MARGIN; @NOXTICS; @YTICS;
f1(x) = m*x + b
fit f1(x) "ten_per_001.log" using 1:2 via m,b
fit f1(x) "ten_per_001.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set title '{/Arial:Bold=10 ten\_per\_001}' offset 0,-2.5
plot "ten_per_001.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle, \
f1(x) w l lw 2 lc 7 notitle

@Y1MARGIN; @X2MARGIN; @NOXTICS; @YTICS;
f2(x) = m*x + b
fit f2(x) "ten_per_002.log" using 1:2 via m,b
fit f2(x) "ten_per_002.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set ytics offset 3.6, 0
set title '{/Arial:Bold=10 ten\_per\_002}' offset 0,-2.5
Expand All @@ -41,7 +41,7 @@ plot "ten_per_002.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y1MARGIN; @X3MARGIN; @NOXTICS; @YTICS;
f3(x) = m*x + b
fit f3(x) "ten_per_003.log" using 1:2 via m,b
fit f3(x) "ten_per_003.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set ytics offset 3.6, 0
set title '{/Arial:Bold=10 ten\_per\_003}' offset 0,-2.5
Expand All @@ -50,7 +50,7 @@ plot "ten_per_003.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y2MARGIN; @X1MARGIN; @NOXTICS; @YTICS;
f4(x) = m*x + b
fit f4(x) "ten_per_004.log" using 1:2 via m,b
fit f4(x) "ten_per_004.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set ytics offset 0,0
set title '{/Arial:Bold=10 ten\_per\_004}' offset 0,-2.5
Expand All @@ -59,7 +59,7 @@ plot "ten_per_004.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y2MARGIN; @X2MARGIN; @NOXTICS; @YTICS;
f5(x) = m*x + b
fit f5(x) "ten_per_005.log" using 1:2 via m,b
fit f5(x) "ten_per_005.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set ytics offset 3.6, 0
set title '{/Arial:Bold=10 ten\_per\_005}' offset 0,-2.5
Expand All @@ -68,7 +68,7 @@ plot "ten_per_005.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y2MARGIN; @X3MARGIN; @NOXTICS; @YTICS;
f6(x) = m*x + b
fit f6(x) "ten_per_006.log" using 1:2 via m,b
fit f6(x) "ten_per_006.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 0.01, 0.01
set ytics offset 5.0, 0
set title '{/Arial:Bold=10 ten\_per\_006}' offset 0,-2.5
Expand All @@ -77,7 +77,7 @@ plot "ten_per_006.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y3MARGIN; @X1MARGIN; @XTICS; @YTICS;
f7(x) = m*x + b
fit f7(x) "ten_per_010.log" using 1:2 via m,b
fit f7(x) "ten_per_010.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 0.01, 0.01
set ytics offset 0,0
set title '{/Arial:Bold=10 ten\_per\_010}' offset 0,-2.5
Expand All @@ -86,7 +86,7 @@ plot "ten_per_010.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y3MARGIN; @X2MARGIN; @XTICS; @YTICS;
f8(x) = m*x + b
fit f8(x) "ten_per_011.log" using 1:2 via m,b
fit f8(x) "ten_per_011.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 50, 50
set ytics offset 4.5, 0
set title '{/Arial:Bold=10 ten\_per\_011}' offset 0,-2.5
Expand All @@ -95,7 +95,7 @@ plot "ten_per_011.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle

@Y3MARGIN; @X3MARGIN; @XTICS; @YTICS;
f9(x) = m*x + b
fit f9(x) "ten_per_012.log" using 1:2 via m,b
fit f9(x) "ten_per_012.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 10, 10
set ytics offset 3.6, 0
set title '{/Arial:Bold=10 ten\_per\_012}' offset 0,-2.5
Expand Down
4 changes: 2 additions & 2 deletions admin/graph_performance/Input/gnuplot_pg2.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ set multiplot layout 3,3 title ARG2." (page 2): ".ARG1 noenhanced scale 0.95,0.9

@Y1MARGIN; @X1MARGIN; @NOXTICS; @YTICS;
f1(x) = m*x + b
fit f1(x) "ten_per_020.log" using 1:2 via m,b
fit f1(x) "ten_per_020.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set title '{/Arial:Bold=10 ten\_per\_020}' offset 0,-2.5
plot "ten_per_020.log" using 1:2 with linespoints lw 1 lc 11 pt 6 ps 0.5 notitle, \
f1(x) w l lw 2 lc 7 notitle

@Y1MARGIN; @X2MARGIN; @NOXTICS; @YTICS;
f2(x) = m*x + b
fit f2(x) "ten_per_021.log" using 1:2 via m,b
fit f2(x) "ten_per_021.log" using 1:2:3 via m,b
set offsets graph 0.0, 0.0, 3, 3
set ytics offset 3.6, 0
set title '{/Arial:Bold=10 ten\_per\_021}' offset 0,-2.5
Expand Down
10 changes: 8 additions & 2 deletions admin/graph_performance/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import numpy as np
from datetime import datetime
from ten.test.basetest import TenNetworkTest
from ten.test.utils.gnuplot import GnuplotHelper
Expand All @@ -12,8 +13,13 @@ def execute(self):

for test in tests:
with open(os.path.join(self.output, '%s.log' % test), 'w') as fp:
for entry in reversed(self.results_db.get_results(test=test, environment=self.env)):
fp.write('%s %s\n' % (self.epoch_to_fractional_doy(entry[0]), entry[1]))
entries = self.results_db.get_results(test=test, environment=self.env)
weights = [1 - (i / (len(entries) - 1)) * (1 - 0.1) for i in range(len(entries))]
count = 0
for entry in reversed(entries):
weight = weights[count]
fp.write('%s %s %s\n' % (self.epoch_to_fractional_doy(entry[0]), entry[1], weight))
count = count + 1
try:
self.graph()
except Exception as e:
Expand Down

0 comments on commit 5c4c0c8

Please sign in to comment.