Calculates the mean of the per class calculated standard deviations. As it is explicitly formulated in: Deep Bayesian Active Learning with Image Data. (Yarin Gal, Riashat Islam, and Zoubin Ghahramani. 2017.) Args: proba: list with the
(proba: list)
| 295 | |
| 296 | |
| 297 | def _mean_standard_deviation(proba: list) -> np.ndarray: |
| 298 | """ |
| 299 | Calculates the mean of the per class calculated standard deviations. |
| 300 | |
| 301 | As it is explicitly formulated in: |
| 302 | Deep Bayesian Active Learning with Image Data. |
| 303 | (Yarin Gal, Riashat Islam, and Zoubin Ghahramani. 2017.) |
| 304 | |
| 305 | Args: |
| 306 | proba: list with the predictions over the dropout cycles |
| 307 | mask: mask to detect the padded classes (must be of same shape as elements in proba) |
| 308 | Return: |
| 309 | Returns the mean standard deviation of the dropout cycles over all classes. |
| 310 | """ |
| 311 | |
| 312 | proba_stacked = np.stack(proba, axis=len(proba[0].shape)) |
| 313 | |
| 314 | standard_deviation_class_vise = np.std(proba_stacked, axis=-1) |
| 315 | mean_standard_deviation = np.mean(standard_deviation_class_vise, where=~np.isnan( |
| 316 | standard_deviation_class_vise), axis=-1) |
| 317 | |
| 318 | return mean_standard_deviation |
| 319 | |
| 320 | |
| 321 | def _entropy(proba: list) -> np.ndarray: |
no outgoing calls
no test coverage detected
searching dependent graphs…