Vote entropy sampling strategy. Args: committee: The committee for which the labels are to be queried. X: The pool of samples to query from. n_instances: Number of samples to be queried. random_tie_break: If True, shuffles utility scores to randomize the ord
(committee: BaseCommittee, X: modALinput,
n_instances: int = 1, random_tie_break=False,
**disagreement_measure_kwargs)
| 100 | |
| 101 | |
| 102 | def vote_entropy_sampling(committee: BaseCommittee, X: modALinput, |
| 103 | n_instances: int = 1, random_tie_break=False, |
| 104 | **disagreement_measure_kwargs) -> np.ndarray: |
| 105 | """ |
| 106 | Vote entropy sampling strategy. |
| 107 | |
| 108 | Args: |
| 109 | committee: The committee for which the labels are to be queried. |
| 110 | X: The pool of samples to query from. |
| 111 | n_instances: Number of samples to be queried. |
| 112 | random_tie_break: If True, shuffles utility scores to randomize the order. This |
| 113 | can be used to break the tie when the highest utility score is not unique. |
| 114 | **disagreement_measure_kwargs: Keyword arguments to be passed for the disagreement |
| 115 | measure function. |
| 116 | |
| 117 | Returns: |
| 118 | The indices of the instances from X chosen to be labelled. |
| 119 | The disagrerment metric of the chosen instances. |
| 120 | |
| 121 | """ |
| 122 | disagreement = vote_entropy(committee, X, **disagreement_measure_kwargs) |
| 123 | |
| 124 | if not random_tie_break: |
| 125 | return multi_argmax(disagreement, n_instances=n_instances) |
| 126 | |
| 127 | return shuffled_argmax(disagreement, n_instances=n_instances) |
| 128 | |
| 129 | |
| 130 | def consensus_entropy_sampling(committee: BaseCommittee, X: modALinput, |
nothing calls this directly
no test coverage detected
searching dependent graphs…