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
4ccd2ec6
Commit
4ccd2ec6
authored
Oct 17, 2023
by
lintangsutawika
Browse files
sqrt final variance calculation to get stderr
parent
e97019c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
lm_eval/evaluator.py
lm_eval/evaluator.py
+7
-0
No files found.
lm_eval/evaluator.py
View file @
4ccd2ec6
...
@@ -478,12 +478,15 @@ def evaluate(
...
@@ -478,12 +478,15 @@ def evaluate(
# if (group in task_order) and task_order[group] == 0:
# if (group in task_order) and task_order[group] == 0:
# current_size = 1
# current_size = 1
all_stderr
=
[]
for
metric
in
[
key
for
key
in
metrics
.
keys
()
if
"_stderr"
not
in
key
]:
for
metric
in
[
key
for
key
in
metrics
.
keys
()
if
"_stderr"
not
in
key
]:
stderr
=
"_stderr,"
.
join
(
metric
.
split
(
","
))
stderr
=
"_stderr,"
.
join
(
metric
.
split
(
","
))
stderr_score
=
results
[
task
][
stderr
]
stderr_score
=
results
[
task
][
stderr
]
metric_score
=
results
[
task
][
metric
]
metric_score
=
results
[
task
][
metric
]
all_stderr
.
append
(
stderr
)
if
metric
in
results
[
group
]:
if
metric
in
results
[
group
]:
results
[
group
][
metric
]
=
(
results
[
group
][
metric
]
*
total_size
+
metric_score
*
current_size
)
/
(
total_size
+
current_size
)
results
[
group
][
metric
]
=
(
results
[
group
][
metric
]
*
total_size
+
metric_score
*
current_size
)
/
(
total_size
+
current_size
)
# $$s_z^2 = \frac{(n-1) s_x^2 + (m-1) s_y^2}{n+m-1} + \frac{nm(\bar x - \bar y)^2}{(n+m)(n+m-1)}.$$
# $$s_z^2 = \frac{(n-1) s_x^2 + (m-1) s_y^2}{n+m-1} + \frac{nm(\bar x - \bar y)^2}{(n+m)(n+m-1)}.$$
...
@@ -494,6 +497,10 @@ def evaluate(
...
@@ -494,6 +497,10 @@ def evaluate(
results
[
group
][
stderr
]
=
stderr_score
results
[
group
][
stderr
]
=
stderr_score
total_size
+=
current_size
total_size
+=
current_size
for
stderr
in
all_stderr
:
results
[
group
][
stderr
]
=
np
.
sqrt
(
results
[
group
][
stderr
])
results
[
group
][
"samples"
]
=
total_size
results
[
group
][
"samples"
]
=
total_size
for
task_name
,
task
in
task_dict
.
items
():
for
task_name
,
task
in
task_dict
.
items
():
...
...
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