scitex_ml.utils.grid_search
This script defines scitex_ml.utils.grid_search
Functions
|
Calculate the total number of combinations possible from the given parameter grid. |
|
Generator function that yields combinations of parameters from a grid. |
- scitex_ml.utils.grid_search.yield_grids(params_grid, random=False)[source]
Generator function that yields combinations of parameters from a grid.
- Parameters:
- Yields:
dict – A dictionary of parameters for one set of conditions from the grid.
Example
# Parameters params_grid = {
“batch_size”: [2**i for i in range(7)], “n_chs”: [2**i for i in range(7)], “seq_len”: [2**i for i in range(15)], “fs”: [2**i for i in range(8, 11)], “n_segments”: [2**i for i in range(6)], “n_bands_pha”: [2**i for i in range(7)], “n_bands_amp”: [2**i for i in range(7)], “precision”: [‘fp16’, ‘fp32’], “device”: [‘cpu’, ‘cuda’], “package”: [‘tensorpac’, ‘scitex’],
}
# Example of using the generator for param_dict in yield_grids(params_grid, random=True):
print(param_dict)