Closed pzhren closed 5 years ago
See
https://docs.scipy.org/doc/numpy/reference/generated/numpy.nanmean.html
I think if there's no nan values, they are the same.
See
https://docs.scipy.org/doc/numpy/reference/generated/numpy.nanmean.html
I think if there's no nan values, they are the same.
However, once nan appears in np.mean, the final result is nan, which does not get m_ap. In fact, a small batch on the charades data set is prone to the fact that the real label labels are all zero. Also, I counted the number of non-zero tags on class 157 of the charades dataset. How to deal with this.
Counted the number of non-zero tags on class 157 of the charades dataset:
A = []
for i in range(157):
a = np.sum(data[1][:,i]==1)
A += [a]
A
Out[56]:
[613,
606,
452,
291,
258,
79,
612,
27,
781,
857,
46,
710,
200,
42,
239,
1043,
663,
217,
291,
217,
661,
351,
275,
272,
86,
186,
613,
275,
239,
91,
252,
58,
479,
567,
273,
280,
149,
125,
224,
95,
328,
177,
196,
177,
145,
34,
100,
255,
98,
91,
82,
344,
338,
228,
172,
153,
154,
190,
72,
1255,
46,
1048,
472,
646,
46,
453,
29,
397,
151,
160,
438,
201,
318,
199,
104,
137,
378,
171,
158,
160,
132,
470,
224,
72,
131,
28,
59,
219,
189,
52,
87,
39,
302,
94,
110,
37,
442,
1417,
361,
100,
125,
25,
235,
36,
205,
188,
1080,
972,
269,
464,
526,
47,
409,
584,
212,
316,
161,
168,
742,
428,
357,
106,
159,
480,
165,
393,
298,
464,
249,
152,
203,
46,
339,
95,
257,
312,
35,
208,
55,
81,
31,
496,
189,
243,
160,
236,
245,
316,
301,
584,
355,
951,
1011,
633,
1326,
366,
927]
https://github.com/wykang/Charades/blob/adc58b7cfe2567f17cc7b62caf4ff4a13a1e8f22/utils/map.py#L26 m_ap = np.mean(m_aps) m_ap = np.nanmean(m_aps) Are these two evaluation indicators the same?