@@ -0,0 +1,1699 @@
+import numpy as np%0A%0Aimport common%0A%0A%0Adef print_reward(inpaths, legend, budget=1e6, last=1e5, sort=False):%0A  runs = common.load_runs(inpaths, budget)%0A  if not legend:%0A    methods = sorted(set(run%5B'method'%5D for run in runs))%0A    legend = %7Bx: x.replace('_', ' ').title() for x in methods%7D%0A  seeds = sorted(%7Bx%5B'seed'%5D for x in runs%7D)%0A  rewards = np.empty((len(legend), len(seeds)))%0A  rewards%5B:%5D = np.nan%0A  for i, (method, label) in enumerate(legend.items()):%0A    relevant = %5Brun for run in runs if run%5B'method'%5D == method%5D%0A    if not relevant:%0A      print(f'No runs found for method %7Bmethod%7D.')%0A    for run in relevant:%0A      j = seeds.index(run%5B'seed'%5D)%0A      xs = np.array(run%5B'xs'%5D)%0A      ys = np.array(run%5B'reward'%5D)%0A      rewards%5Bi%5D%5Bj%5D = ys%5B-(xs %3E= (xs.max() - last)).sum()%5D%0A  means = np.nanmean(rewards, -1)%0A  stds = np.nanstd(rewards, -1)%0A  print('')%0A  print(r'%5Ctextbf%7BMethod%7D & %5Ctextbf%7BReward%7D %5C%5C')%0A  print('')%0A  for method, mean, std in zip(legend.values(), means, stds):%0A    mean = f'%7Bmean:.1f%7D'%0A    mean = (r'%5Co' if len(mean) %3C 4 else ' ') + mean%0A    print(rf'%7Bmethod:%3C25%7D & $%7Bmean%7D %5Cpm %7Bstd:4.1f%7D$ %5C%5C')%0A  print('')%0A%0A%0Ainpaths = %5B%0A    'scores/crafter_reward-dreamerv2.json',%0A    'scores/crafter_reward-ppo.json',%0A    'scores/crafter_reward-rainbow.json',%0A    'scores/crafter_noreward-unsup_plan2explore.json',%0A    'scores/crafter_noreward-unsup_rnd.json',%0A    'scores/crafter_noreward-random.json',%0A    'scores/crafter_reward-human.json',%0A%5D%0Alegend = %7B%0A    'human': 'Human Experts',%0A    'dreamerv2': 'DreamerV2',%0A    'ppo': 'PPO',%0A    'rainbow': 'Rainbow',%0A    'unsup_plan2explore': 'Plan2Explore (Unsup)',%0A    'unsup_rnd': 'RND (Unsup)',%0A    'random': 'Random',%0A%7D%0Aprint_reward(inpaths, legend)%0A

Add script to print reward table.