自动神经网络架构搜索
AutoNAS 模式的入口点。
类
一个用于处理自动模式下模型猴子补丁的类。 |
|
一个迭代搜索器,使用进化算法来优化子网配置。 |
|
迭代搜索算法的基类。 |
|
一个迭代搜索器,随机采样子网。 |
函数
使用正确的补丁管理器为AutoNAS模式转换搜索空间。 |
|
将给定模型转换为搜索空间。 |
|
将搜索空间的子网配置导出为常规模型。 |
|
使用正确的补丁管理器恢复AutoNAS模式的搜索空间。 |
|
恢复并导出搜索空间的子网配置到常规模型。 |
|
从给定的模型中恢复搜索空间。 |
|
更新子网配置以匹配模型的当前子网配置。 |
- class AutoNASPatchManager
基础类:
PatchManager一个用于处理自动模式下模型猴子补丁的类。
- property sample_during_training: bool
指示我们是否应该在训练期间采样一个新的子网。
- class EvolveSearcher
基础类:
IterativeSearcher一个迭代搜索器,使用进化算法来优化子网配置。
- after_step()
在每次迭代步骤后更新人口。
- Return type:
无
- before_search()
在搜索之前,将约束的下限设置为上限的0.85倍。
- Return type:
无
- before_step()
在每次迭代步骤之前更新候选者和种群。
- Return type:
无
- candidates: List[Dict[str, Any]]
- property default_search_config: Dict[str, Any]
默认搜索配置包含额外的算法参数。
- property default_state_dict: Dict[str, Any]
返回默认状态字典。
- population: List[Dict[str, Any]]
- sample()
采样一个新的子网涉及随机采样、变异和交叉。
- Return type:
Dict[str, Any]
- class IterativeSearcher
基础类:
BaseSearcher,ABC迭代搜索算法的基类。
- after_search()
选择最佳模型。
- Return type:
无
- after_step()
在每次迭代步骤后运行。
- Return type:
无
- before_search()
确保模型实际上是可配置的,并且准备好进行评估。
- Return type:
无
- before_step()
在每次迭代步骤之前运行。
- Return type:
无
- best: Dict[str, Any]
- best_history: Dict[str, Any]
- candidate: Dict[str, Any]
- constraints_func: ConstraintsFunc
- property default_search_config: Dict[str, Any]
获取搜索器的默认配置。
- property default_state_dict: Dict[str, Any]
返回默认状态字典。
- early_stop()
检查是否应该尽可能提前停止搜索。
- Return type:
bool
- history: Dict[str, Any]
- iter_num: int
- num_satisfied: int
- run_search()
运行迭代搜索循环。
- Return type:
无
- run_step()
每个迭代步骤的主要例程。
- Return type:
无
- abstract sample()
采样并选择新的子网配置并返回配置。
- Return type:
Dict[str, Any]
- samples: Dict[str, Any]
- sanitize_search_config(config)
清理搜索配置字典。
- Parameters:
config (Dict[str, Any] | None) –
- Return type:
Dict[str, Any]
- class RandomSearcher
基础类:
IterativeSearcher一个迭代搜索器,随机采样子网。
- sample()
在每一步中随机抽取新的子集。
- Return type:
Dict[str, Any]
- convert_autonas_searchspace(model, config)
使用正确的补丁管理器为AutoNAS模式转换搜索空间。
- Parameters:
模型 (模块) –
config (ModeloptBaseConfig) –
- Return type:
元组[模块, 字典[字符串, 任意类型]]
- convert_searchspace(model, config, patch_manager_type)
将给定模型转换为搜索空间。
- Parameters:
模型 (模块) –
config (ModeloptBaseConfig) –
patch_manager_type (类型[PatchManager]) –
- Return type:
元组[模块, 字典[字符串, 任意类型]]
- export_searchspace(model, config)
将搜索空间的子网配置导出为常规模型。
- Parameters:
模型 (模块) –
config (ExportConfig) –
- Return type:
元组[模块, 字典[字符串, 任意类型]]
- restore_autonas_searchspace(model, config, metadata)
使用正确的补丁管理器恢复AutoNAS模式的搜索空间。
- Parameters:
模型 (模块) –
config (ModeloptBaseConfig) –
metadata (Dict[str, Any]) –
- Return type:
模块
- restore_export(model, config, metadata)
恢复并导出搜索空间的子网配置到常规模型。
- Parameters:
模型 (模块) –
config (ExportConfig) –
metadata (Dict[str, Any]) –
- Return type:
模块
- restore_searchspace(model, config, metadata, patch_manager)
从给定的模型中恢复搜索空间。
- Parameters:
模型 (模块) –
config (ModeloptBaseConfig) –
metadata (Dict[str, Any]) –
patch_manager (类型[PatchManager]) –
- Return type:
模块
- update_autonas_metadata(model, config, metadata)
更新子网配置以匹配模型的当前子网配置。
- Parameters:
模型 (模块) –
config (ModeloptBaseConfig) –
metadata (Dict[str, Any]) –
- Return type:
无