CoolFace
Apppublic

The-Myth/DeepThinkers

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes
plot_metrics.py29 linesDownload Raw Back to root
1import json
2import matplotlib.pyplot as plt
3from collections import defaultdict
4
5# Load results
6with open("results.json") as f:
7    data = json.load(f)
8
9# Group by task
10task_rewards = defaultdict(list)
11
12for d in data:
13    task_rewards[d["task"]].append(d["reward"])
14
15# Average reward per task
16tasks = []
17avg_rewards = []
18
19for task, rewards in task_rewards.items():
20    tasks.append(task)
21    avg_rewards.append(sum(rewards) / len(rewards))
22
23# Plot
24plt.figure()
25plt.bar(tasks, avg_rewards)
26plt.xlabel("Tasks")
27plt.ylabel("Average Reward")
28plt.title("Model Performance per Task")
29plt.show()