Unverified Commit a5bfc075 authored by shivam_khandelwal's avatar shivam_khandelwal
Browse files

Updated scoring from summission of rewards to average reward

parent bac84b96
......@@ -104,8 +104,18 @@ class Parser:
if self.totalInstances > 0 and not instance_running:
self.payload['state'] = 'FINISHED'
self.payload['instances'] = self.current_state
score = 0.0
instances = 0
for state in self.current_state:
episodes = self.current_state[state]['episodes']
for episode in episodes:
score += episode['rewards']
instances += 1
if instances > 0:
score = str(round(score/instances, 2))
self.payload['score'] = {
'score': sum(self.current_state[x]['score']['score'] for x in self.current_state),
'score': score,
'score_secondary': sum(self.current_state[x]['score']['score_secondary'] for x in self.current_state)
}
......@@ -220,6 +230,9 @@ class Parser:
else:
break
if len(payload['episodes']) > 0:
score = str(round(score/len(payload['episodes']), 2))
payload['score'] = {
"score": score,
"score_secondary": 0.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment