ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.28k stars 5.82k forks source link

[tune][Feature] add tune.choices to select multiple values from a search space #23001

Open Rusteam opened 2 years ago

Rusteam commented 2 years ago

Search before asking

Description

There're cases when I want to optimize a subsample from a list of options, for instance, image augmentations.

I have a list of augmentations such as [crop, color, weather, randaugment, rotate, randerasing, etc.] and I want to use ray.tune to find best subset of augmentations. In order to achieve that I want to be able to select multiple options from the original list for each trial.

Use case

A list of image augmentations.

Related issues

No response

Are you willing to submit a PR?

amogkam commented 2 years ago

Hey @Rusteam, thanks for raising this! Yes this is definitely a nice-to-have enhancement we could add!

For now, it should still be possible select N different values from a list, by either using N different hyperparameters (or nested hyperparameters) and with the same exact search space and doing a tune.choice on each of them, or using something like itertools.permutation to generate all the subsets beforehand into a single search space that you select from.