Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 452898f commit f8778f5Copy full SHA for f8778f5
modAL/batch.py
@@ -101,7 +101,10 @@ def select_instance(
101
scores = alpha * (1 - similarity_scores) + (1 - alpha) * X_uncertainty[mask]
102
103
# Isolate and return our best instance for labeling as the one with the largest score.
104
- best_instance_index = np.argmax(scores)
+ best_instance_index_in_unlabeled = np.argmax(scores)
105
+ n_pool, _ = X_pool.shape
106
+ unlabeled_indices = [i for i in range(n_pool) if mask[i]]
107
+ best_instance_index = unlabeled_indices[best_instance_index_in_unlabeled]
108
mask[best_instance_index] = 0
109
return best_instance_index, X_pool[best_instance_index].reshape(1, -1), mask
110
0 commit comments