(active_learner, X, K=16, N=16)
| 46 | |
| 47 | |
| 48 | def max_entropy(active_learner, X, K=16, N=16): |
| 49 | |
| 50 | class_prob = active_learner.predict_proba(X) |
| 51 | entropy = entr(class_prob).sum(axis=1) |
| 52 | uncertain_idx = np.argpartition(entropy, -K)[-K:] |
| 53 | |
| 54 | """ |
| 55 | Original Implementation -- Pick most confident samples with |
| 56 | entropy less than a threshold. Threshold is decayed in every |
| 57 | iteration. |
| 58 | |
| 59 | Different than original -- Pick top n most confident samples. |
| 60 | """ |
| 61 | |
| 62 | confidence_idx = np.argpartition(entropy, N)[:N] |
| 63 | |
| 64 | return np.concatenate((uncertain_idx, confidence_idx), axis=0) |
| 65 | |
| 66 | |
| 67 | active_learner = ActiveLearner( |
nothing calls this directly
no test coverage detected
searching dependent graphs…