Consensus 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 th
(committee: BaseCommittee, X: modALinput,
n_instances: int = 1, random_tie_break=False,
**disagreement_measure_kwargs)
| 128 | |
| 129 | |
| 130 | def consensus_entropy_sampling(committee: BaseCommittee, X: modALinput, |
| 131 | n_instances: int = 1, random_tie_break=False, |
| 132 | **disagreement_measure_kwargs) -> np.ndarray: |
| 133 | """ |
| 134 | Consensus entropy sampling strategy. |
| 135 | |
| 136 | Args: |
| 137 | committee: The committee for which the labels are to be queried. |
| 138 | X: The pool of samples to query from. |
| 139 | n_instances: Number of samples to be queried. |
| 140 | random_tie_break: If True, shuffles utility scores to randomize the order. This |
| 141 | can be used to break the tie when the highest utility score is not unique. |
| 142 | **disagreement_measure_kwargs: Keyword arguments to be passed for the disagreement |
| 143 | measure function. |
| 144 | |
| 145 | Returns: |
| 146 | The indices of the instances from X chosen to be labelled. |
| 147 | The disagrerment metric of the chosen instances. |
| 148 | |
| 149 | """ |
| 150 | disagreement = consensus_entropy(committee, X, **disagreement_measure_kwargs) |
| 151 | |
| 152 | if not random_tie_break: |
| 153 | return multi_argmax(disagreement, n_instances=n_instances) |
| 154 | |
| 155 | return shuffled_argmax(disagreement, n_instances=n_instances) |
| 156 | |
| 157 | |
| 158 | def max_disagreement_sampling(committee: BaseCommittee, X: modALinput, |
nothing calls this directly
no test coverage detected
searching dependent graphs…