multiml.agent.basic.random_search module
RandomSearchAgent module.
- class multiml.agent.basic.random_search.RandomSearchAgent(samplings=None, seed=0, metric_type=None, num_workers=None, context='spawn', dump_all_results=False, disable_tqdm=True, **kwargs)
Bases:
SequentialAgent
Agent executing random search..
- __init__(samplings=None, seed=0, metric_type=None, num_workers=None, context='spawn', dump_all_results=False, disable_tqdm=True, **kwargs)
Initialize simple agent.
- Parameters:
samplings (int or list) – If int, number of random samplings. If list, indexes of combination.
seed (int) – seed of random samplings.
metric_type (str) – ‘min’ or ‘max’ for indicating direction of metric optimization. If it is None,
type
is retrieved from metric class instance.num_workers (int or list) – number of workers for multiprocessing or lsit of GPU ids. If
num_workers
is given, multiprocessing is enabled.context (str) – fork (default) or spawn.
dump_all_results (bool) – dump all results or not.
disable_tqdm (bool) – enable tqdm bar.
- property history
Return history of execution.
- execute()
Execute simple agent.
- finalize()
Finalize grid scan agent.
- execute_jobs(ctx, queue, args)
(expert method) Execute multiprocessing jobs.
- execute_pool_jobs(ctx, queue, args)
(expert method) Execute multiprocessing pool jobs.
- execute_wrapper(queue, subtasktuples, counter, cuda_id)
(expert method) Wrapper method to execute multiprocessing pipeline.