evox.problems.hpo_wrapper
#
模块内容#
类#
用于 |
|
用于超参数优化(HPO)的监视器,记录在优化过程中迄今为止发现的最佳适应度。 |
|
超参数优化(HPO)问题。 |
API#
- class evox.problems.hpo_wrapper.HPOMonitor[源代码]#
Bases:
evox.core.Monitor
,abc.ABC
用于
HPOProblem.workflow.monitor
中的超参数优化(HPO)监控的基类。初始化
初始化 ModuleBase。
- 参数:
*args -- 可变长度参数列表,传递给父类的初始化函数。
**kwargs -- 任意关键字参数,传递给父类初始化器。
Attributes: static_names (list): A list to store static member names.
- class evox.problems.hpo_wrapper.HPOFitnessMonitor(multi_obj_metric: Optional[Callable] = None)[源代码]#
Bases:
evox.problems.hpo_wrapper.HPOMonitor
用于超参数优化(HPO)的监视器,记录在优化过程中迄今为止发现的最佳适应度。
初始化
初始化 HPO 适应度监控器。
- 参数:
multi_obj_metric -- 用于多目标优化的度量函数,在单目标优化中不使用。目前,我们仅支持多目标优化的“IGD”或“HV”。默认为None。
- class evox.problems.hpo_wrapper.HPOProblemWrapper(iterations: int, num_instances: int, workflow: evox.core.Workflow, copy_init_state: bool = True)[源代码]#
Bases:
evox.core.Problem
超参数优化(HPO)问题。
Usage
algo = SomeAlgorithm(...) algo.setup(...) prob = SomeProblem(...) prob.setup(...) monitor = HPOFitnessMonitor() workflow = StdWorkflow() workflow.setup(algo, prob, monitor=monitor) hpo_prob = HPOProblemWrapper(iterations=..., num_instances=...) hpo_prob.setup(workflow) params = HPOProblemWrapper.extract_parameters(hpo_prob.init_state) hpo_prob.evaluate(params) # execute the evaluation # ...
初始化
初始化 HPO 问题包装器。
- 参数:
iterations -- 在优化过程中要执行的迭代次数。
num_instances -- 在优化过程中并行执行的实例数量。
workflow -- 在优化过程中使用的工作流。必须由 core.jit_class 包装。
copy_init_state -- 是否为每次评估复制工作流的初始状态。默认为 True。如果您的工作流包含对初始状态中的张量进行原地修改的操作,则应将其设置为 True。否则,您可以将其设置为 False 以节省内存。