Core-set selection
- TlseHypDataSet.utils.coreset.core_set_selection(dataset, budget=10, metric=None, dim_reduction='autoencoder', n_components=8)
Performs a class-wise core-set selection with a k-center greedy algorithm as implemented in https://github.com/PatrickZH/DeepCore
- Parameters
dataset – a torch.utils.data.Dataset object
budget – number of samples to select by class
metric – distance metric to use (a callable)
dim_reduction – method to represent the data in a lower dimensional space (‘pca’ or ‘autoencoder’)
n_components – dimension of the representation space
- Returns
A core-set selection of the data
- TlseHypDataSet.utils.coreset.random_selection(dataset, budget=10)
Performs a class-wise random selection
- Parameters
dataset – a torch.utils.data.Dataset object
budget – number of samples to select by class
- Returns
A random selection of the data