chrisjay commited on
Commit
ad80e42
1 Parent(s): e838107

fixed issue with one parsed result

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -53,13 +53,20 @@ def parse_metrics_accuracy(meta):
53
 
54
  # We keep the worst case episode
55
  def parse_rewards(accuracy):
 
 
56
  if accuracy != None:
57
- parsed = accuracy.split(' +/- ')
58
- mean_reward = float(parsed[0])
59
- std_reward = float(parsed[1])
 
 
 
 
 
60
  else:
61
- mean_reward = -1000
62
- std_reward = -1000
63
  return mean_reward, std_reward
64
 
65
  def get_data(rl_env):
 
53
 
54
  # We keep the worst case episode
55
  def parse_rewards(accuracy):
56
+ default_std = -1000
57
+ default_reward=-1000
58
  if accuracy != None:
59
+ parsed = accuracy.split(' +/- ')
60
+ if len(parsed)>1:
61
+ mean_reward = float(parsed[0])
62
+ std_reward = float(parsed[1])
63
+ else:
64
+ mean_reward = default_std
65
+ std_reward = default_reward
66
+
67
  else:
68
+ mean_reward = default_std
69
+ std_reward = default_reward
70
  return mean_reward, std_reward
71
 
72
  def get_data(rl_env):