MTG / gaia

C++ library to apply similarity measures and classifications on the results of audio analysis, including Python bindings. Together with Essentia it can be used to compute high-level descriptions of music.
http://essentia.upf.edu
GNU Affero General Public License v3.0
271 stars 66 forks source link

Add option to specify number of threads on model training #95

Closed alastair closed 1 year ago

alastair commented 4 years ago

Tools like make and waf have a -j (jobs) flag to specify the number of threads to use. In Gaia we just use the number of available threads.

It'd be nice to add this option to train_model_from_sigs and train_model. Should this option be in the profile file? It sounds to me like it should instead be only a parameter, but train_model calls run_tests.runTests directly, which creates a ClassificationTaskManager (which only takes a profile file as an argument). In order to get this parameter into ClassificationTaskManager, we might have to pass it as an argument through all of these files.

Ideas?

dbogdanov commented 4 years ago

If we think that profile files are supposed to be shareable in order to reproduce an experiment across machines, then I don't think that the number of threads should really belong there.

alastair commented 4 years ago

so we should definitely take a -j flag and pass it through all of the functions. We can still default to the number of detected cores