Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 1.34 KB

select_examples.md

File metadata and controls

74 lines (57 loc) · 1.34 KB

TFSimilarity.samplers.select_examples

Randomly select at most N examples per class

TFSimilarity.samplers.select_examples(
    class_list: Sequence[int] = None,
    num_examples_per_class: int = None
) -> Tuple[np.ndarray, np.ndarray]

Args

x A 2-D Tensor containing the data.
y A 1-D Tensor containing the labels.
class_list Filter the list of examples to only keep thoses those who belong to the supplied class list. In no class is supplied, keep examples for all the classes. Default to None - keep all the examples.
num_examples_per_class Restrict the number of examples for EACH class to num_examples_per_class if set. If not set, all the available examples are selected. Defaults to None - no selection.

Returns

A Tuple containing the subset of x and y.