multiml.agent.RandomSearchAgent

class multiml.agent.RandomSearchAgent(samplings=None, seed=0, metric_type=None, num_workers=None, context='spawn', dump_all_results=False, disable_tqdm=True, **kwargs)

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.

Methods

__init__([samplings, seed, metric_type, ...])

Initialize simple agent.

execute()

Execute simple agent.

execute_differentiable(subtasktuples, counter)

Execute connection model.

execute_finalize()

Execute and finalize base agent.

execute_jobs(ctx, queue, args)

(expert method) Execute multiprocessing jobs.

execute_pipeline(subtasktuples, counter[, trial])

Execute pipeline.

execute_pool_jobs(ctx, queue, args)

(expert method) Execute multiprocessing pool jobs.

execute_subtasktuples(subtasktuples, counter)

Execute given subtasktuples.

execute_wrapper(queue, subtasktuples, ...)

(expert method) Wrapper method to execute multiprocessing pipeline.

finalize()

Finalize grid scan agent.

Attributes

history

Return history of execution.

metric

Return metric of base agent.

result

Return result of execution.

saver

Return saver of base agent.

storegate

Return storegate of base agent.

task_scheduler

Return task_scheduler of base agent.

__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.