jmschrei / apricot

apricot implements submodular optimization for the purpose of selecting subsets of massive data sets to train machine learning models quickly. See the documentation page: https://apricot-select.readthedocs.io/en/latest/index.html
MIT License
499 stars 48 forks source link

[MRG] Add in GPU support #4

Closed jmschrei closed 5 years ago

jmschrei commented 5 years ago

This PR adds in GPU support for both FeatureBasedSelection and FacilityLocationSelection via cupy as well as corresponding unit tests. The GPU is enabled when these selectors are passed in a cupy.array object, much like sparse mode is enabled with a scipy.sparse.csr_matrix is passed in. Currently, only the naive greedy selection algorithm is accelerated, as the lazy greedy algorithm does not lend itself to native parallelization.