Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
50a8ddfb
"vscode:/vscode.git/clone" did not exist on "d6bfe2a937b1438f9785a77823350e83a6408831"
Commit
50a8ddfb
authored
Aug 19, 2023
by
Herbie Bradley
Browse files
Allow sample logging of calibration data
parent
a6bd7126
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
lm_eval/api/metrics.py
lm_eval/api/metrics.py
+0
-1
lm_eval/api/task.py
lm_eval/api/task.py
+3
-3
No files found.
lm_eval/api/metrics.py
View file @
50a8ddfb
...
...
@@ -130,7 +130,6 @@ def ece_fn(items): # This is a passthrough function
This consists of the average absolute difference between the fraction of
model predictions which are correct and the mean of the model's normalized
probability for those predictions (after binning), for multiple choice questions.
Lower is better.
Paper: https://arxiv.org/abs/2207.05221
"""
...
...
lm_eval/api/task.py
View file @
50a8ddfb
...
...
@@ -966,14 +966,14 @@ class ConfigurableTask(Task):
if
"ece"
in
use_metric
:
# Convert lls from log-probabilities to normalized probabilities
norm_probs
:
np
.
ndarray
=
np
.
exp
(
lls
-
sp
.
logsumexp
(
lls
))
calib_scores
:
np
.
ndarray
=
np
.
zeros
(
len
(
choices
)
)
norm_probs
:
list
[
float
]
=
np
.
exp
(
lls
-
sp
.
logsumexp
(
lls
))
.
tolist
()
calib_scores
:
list
[
float
]
=
[
0.0
]
*
len
(
choices
)
if
isinstance
(
gold
,
list
):
for
g
in
gold
:
calib_scores
[
g
]
=
1.0
else
:
calib_scores
[
gold
]
=
1.0
calibration_probs
:
dict
[
str
,
np
.
ndarray
]
=
{
calibration_probs
:
dict
[
str
,
list
[
float
]
]
=
{
"probs"
:
norm_probs
,
"scores"
:
calib_scores
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment