small fixes

This commit is contained in:
Christoffer Müller Madsen 2018-03-08 17:51:32 +01:00
parent 150036a6cb
commit f3f0e40aa4
Signed by: christoffer
GPG Key ID: 337BA5A95E686EFD
2 changed files with 5 additions and 3 deletions

View File

@ -9,7 +9,7 @@ def print_train_outcome(outcome, init_ep = 0):
print("train;{init_ep};{count};{sum};{mean}".format(**format_vars)) print("train;{init_ep};{count};{sum};{mean}".format(**format_vars))
def print_eval_outcomes(outcomes, init_ep = 0): def print_eval_outcomes(outcomes, init_ep = 0):
for outcome in eval_outcomes: for outcome in outcomes:
scores = outcome[1] scores = outcome[1]
format_vars = { 'init_ep': init_ep, format_vars = { 'init_ep': init_ep,
'method': outcome[0], 'method': outcome[0],

View File

@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
import matplotlib.ticker as mtick import matplotlib.ticker as mtick
import matplotlib.dates as mdates import matplotlib.dates as mdates
from matplotlib.backends.backend_pdf import PdfPages from matplotlib.backends.backend_pdf import PdfPages
headers = ['Phase', 'Method', 'Total episodes', 'Episodes', 'Sum', 'Mean'] headers = ['Phase', 'Method', 'Start episodes', 'Episodes', 'Sum', 'Mean']
fig, ax = plt.subplots(1, 1) fig, ax = plt.subplots(1, 1)
@ -24,11 +24,13 @@ plt.show()
while True: while True:
#df = pd.read_csv(sys.stdin, sep=";", names=headers) #df = pd.read_csv(sys.stdin, sep=";", names=headers)
df = pd.read_csv('log', sep=";", names=headers) df = pd.read_csv('log', sep=";", names=headers)
df['Total episodes'] = df['Start episodes'] + 100
print(df)
x = df['Total episodes'] x = df['Total episodes']
y = df['Mean'] y = df['Mean']
plt.scatter(x, y, c=[[1,0.5,0]]) plt.scatter(x, y, c=[[1,0.5,0]])
print("draw")
#fig.canvas.draw() #fig.canvas.draw()
plt.pause(2) plt.pause(2)