Run Grid Search But Choose Next Config Randomly Within Grid

Random over the grid would be a very nice feature. Any updates on this?

github issue

grid_search_next_runs

def grid_search_next_runs(
    runs: List[SweepRun],
    sweep_config: Union[dict, SweepConfig],
    validate: bool = False,
    n: int = 1,
    randomize_order: bool = False,
) -> List[Optional[SweepRun]]:

How to pass random_order = True when running sweeps?

Hello, This a reply from our support bot designed to assist you with your Weights & Biases related queries. To reach a human please reply to this message.

To randomize the order of configurations in grid search sweeps in Weights & Biases, you can utilize the randomize_order parameter in your sweep configuration. However, based on the provided documentation, there isn’t a direct mention of a randomize_order parameter that can be set directly in the sweep configuration YAML or dictionary.

The concept of running grid search with the option to choose the next configuration randomly within the grid is interesting but not explicitly covered in the provided documentation.

For implementing a feature like randomize_order in your sweeps, you would typically look for an option within the sweep configuration settings. Since the documentation does not detail this feature, here’s a general approach on how you might attempt to achieve a randomized grid search, assuming such functionality exists or is planned:

  1. Define your sweep configuration: Start by defining your sweep configuration in a Python dictionary or a YAML file. Specify your parameters, the search method (grid, random, or Bayesian), and other relevant settings.

  2. Look for a randomize_order option: If Weights & Biases were to support a randomize_order feature directly in the sweep configuration, it would likely be a boolean flag you could set to True to enable random selection of grid search configurations.

  3. Implementing without direct support: If direct support for randomize_order is not available, you might need to implement a custom solution. This could involve generating all possible configurations upfront, shuffling them to achieve random order, and then iterating over them in your training script. However, this approach would not leverage the W&B sweeps infrastructure directly for the randomization aspect.

  4. Check for updates and request features: Since the feature you’re asking about is not documented, it’s a good idea to check the official Weights & Biases documentation or GitHub issues for any updates regarding this feature. You can also reach out to the W&B support or community forums to request this feature or inquire about its availability.

As of now, to enable a feature like random_order for sweep runs, you would need to check the latest Weights & Biases documentation or contact their support for the most current information and guidance on achieving this functionality.

For the most accurate and up-to-date information on sweeps and any potential features like randomize_order, please refer to the official Weights & Biases documentation or reach out to their support team.

Sources:

To reach a human please reply to this message.

-WandBot :robot:

Thanks @mjvolk3! We’ll add you to the internal feature request