Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit e6634f9

Browse files
authored
Improved metrics config (#21)
1 parent 9849298 commit e6634f9

File tree

2 files changed

+50
-12
lines changed
  • kilroy_module_pytorch_py_sdk/src/kilroy_module_pytorch_py_sdk/modules

2 files changed

+50
-12
lines changed

kilroy_module_pytorch_py_sdk/src/kilroy_module_pytorch_py_sdk/modules/basic.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ def label(cls) -> str:
6161
def config(cls) -> Dict[str, Any]:
6262
return {
6363
"type": "line",
64-
"data": {"datasets": [{"data": []}]},
65-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "loss"}},
64+
"data": {"datasets": [{"label": "Supervised Loss", "data": []}]},
65+
"options": {
66+
"parsing": {"xAxisKey": "step", "yAxisKey": "loss"},
67+
"scales": {
68+
"x": {"title": {"text": "Step"}},
69+
"y": {"title": {"text": "Loss"}},
70+
},
71+
},
6672
}
6773

6874

@@ -79,8 +85,14 @@ def label(cls) -> str:
7985
def config(cls) -> Dict[str, Any]:
8086
return {
8187
"type": "line",
82-
"data": {"datasets": [{"data": []}]},
83-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "score"}},
88+
"data": {"datasets": [{"label": "Reinforced Score", "data": []}]},
89+
"options": {
90+
"parsing": {"xAxisKey": "step", "yAxisKey": "score"},
91+
"scales": {
92+
"x": {"title": {"text": "Step"}},
93+
"y": {"title": {"text": "Score"}},
94+
},
95+
},
8496
}
8597

8698

kilroy_module_pytorch_py_sdk/src/kilroy_module_pytorch_py_sdk/modules/reward.py

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ def label(cls) -> str:
6666
def config(cls) -> Dict[str, Any]:
6767
return {
6868
"type": "line",
69-
"data": {"datasets": [{"data": []}]},
70-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "loss"}},
69+
"data": {"datasets": [{"label": "Supervised Loss", "data": []}]},
70+
"options": {
71+
"parsing": {"xAxisKey": "step", "yAxisKey": "loss"},
72+
"scales": {
73+
"x": {"title": {"text": "Step"}},
74+
"y": {"title": {"text": "Loss"}},
75+
},
76+
},
7177
}
7278

7379

@@ -84,8 +90,14 @@ def label(cls) -> str:
8490
def config(cls) -> Dict[str, Any]:
8591
return {
8692
"type": "line",
87-
"data": {"datasets": [{"data": []}]},
88-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "score"}},
93+
"data": {"datasets": [{"label": "Reinforced Score", "data": []}]},
94+
"options": {
95+
"parsing": {"xAxisKey": "step", "yAxisKey": "score"},
96+
"scales": {
97+
"x": {"title": {"text": "Step"}},
98+
"y": {"title": {"text": "Score"}},
99+
},
100+
},
89101
}
90102

91103

@@ -102,8 +114,14 @@ def label(cls) -> str:
102114
def config(cls) -> Dict[str, Any]:
103115
return {
104116
"type": "line",
105-
"data": {"datasets": [{"data": []}]},
106-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "loss"}},
117+
"data": {"datasets": [{"label": "Reward Model Loss", "data": []}]},
118+
"options": {
119+
"parsing": {"xAxisKey": "step", "yAxisKey": "loss"},
120+
"scales": {
121+
"x": {"title": {"text": "Step"}},
122+
"y": {"title": {"text": "Loss"}},
123+
},
124+
},
107125
}
108126

109127

@@ -120,8 +138,16 @@ def label(cls) -> str:
120138
def config(cls) -> Dict[str, Any]:
121139
return {
122140
"type": "line",
123-
"data": {"datasets": [{"data": []}]},
124-
"options": {"parsing": {"xAxisKey": "step", "yAxisKey": "score"}},
141+
"data": {
142+
"datasets": [{"label": "Reward Model Score", "data": []}]
143+
},
144+
"options": {
145+
"parsing": {"xAxisKey": "step", "yAxisKey": "score"},
146+
"scales": {
147+
"x": {"title": {"text": "Step"}},
148+
"y": {"title": {"text": "Score"}},
149+
},
150+
},
125151
}
126152

127153

0 commit comments

Comments
 (0)