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
5e4f1799
Commit
5e4f1799
authored
Nov 14, 2023
by
lintangsutawika
Browse files
brier score for loglikelihood task
parent
6998762a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
lm_eval/api/task.py
lm_eval/api/task.py
+7
-0
No files found.
lm_eval/api/task.py
View file @
5e4f1799
...
@@ -960,9 +960,16 @@ class ConfigurableTask(Task):
...
@@ -960,9 +960,16 @@ class ConfigurableTask(Task):
if
self
.
OUTPUT_TYPE
==
"loglikelihood"
:
if
self
.
OUTPUT_TYPE
==
"loglikelihood"
:
results
=
results
[
0
]
results
=
results
[
0
]
ll
,
is_greedy
=
results
ll
,
is_greedy
=
results
prob_norm
=
np
.
exp
(
ll
)
return
{
return
{
**
({
"perplexity"
:
ll
}
if
"perplexity"
in
use_metric
else
{}),
**
({
"perplexity"
:
ll
}
if
"perplexity"
in
use_metric
else
{}),
**
({
"acc"
:
int
(
is_greedy
)}
if
"acc"
in
use_metric
else
{}),
**
({
"acc"
:
int
(
is_greedy
)}
if
"acc"
in
use_metric
else
{}),
**
(
{
"brier_score"
:
(
0
,
[
prob_norm
])}
# Gold is Index 0
if
"brier_score"
in
use_metric
else
{}
),
}
}
elif
self
.
OUTPUT_TYPE
==
"loglikelihood_rolling"
:
elif
self
.
OUTPUT_TYPE
==
"loglikelihood_rolling"
:
(
loglikelihood
,)
=
results
(
loglikelihood
,)
=
results
...
...
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