Spaces:
Runtime error
Runtime error
Remove name in output
Browse files- peak_signal_to_noise_ratio.py +1 -1
- tests.py +2 -2
peak_signal_to_noise_ratio.py
CHANGED
@@ -89,5 +89,5 @@ class PeakSignaltoNoiseRatio(evaluate.Metric):
|
|
89 |
psnrs = list(map(
|
90 |
lambda args: peak_signal_noise_ratio(*args, data_range=data_range), samples
|
91 |
))
|
92 |
-
return
|
93 |
|
|
|
89 |
psnrs = list(map(
|
90 |
lambda args: peak_signal_noise_ratio(*args, data_range=data_range), samples
|
91 |
))
|
92 |
+
return np.average(psnrs, weights=sample_weight)
|
93 |
|
tests.py
CHANGED
@@ -2,11 +2,11 @@ test_cases = [
|
|
2 |
{
|
3 |
"predictions": [[0.1, 0.1], [1.1, 0.1]],
|
4 |
"references": [[0.1, 0.1], [1.1, 0.1]],
|
5 |
-
"result":
|
6 |
},
|
7 |
{
|
8 |
"predictions": [[0, 1], [0, 0]],
|
9 |
"references": [[0, 0], [-1, -1]],
|
10 |
-
"result":
|
11 |
}
|
12 |
]
|
|
|
2 |
{
|
3 |
"predictions": [[0.1, 0.1], [1.1, 0.1]],
|
4 |
"references": [[0.1, 0.1], [1.1, 0.1]],
|
5 |
+
"result": 23.010298856486173
|
6 |
},
|
7 |
{
|
8 |
"predictions": [[0, 1], [0, 0]],
|
9 |
"references": [[0, 0], [-1, -1]],
|
10 |
+
"result": 1.2493873660829993
|
11 |
}
|
12 |
]
|