fastnas

实现用于搜索的fasnas剪枝算法的模块。

BinarySearcher

一个使用二分搜索来找到最佳配置的迭代搜索器。

FastNASPatchManager

FastNAS的补丁管理器(与AutoNAS相同,除了在训练期间不进行采样)。

函数

convert_fastnas_searchspace

使用正确的补丁管理器为FastNAS模式转换搜索空间。

restore_fastnas_searchspace

使用正确的补丁管理器恢复FastNAS模式的搜索空间。

class BinarySearcher

基础类: IterativeSearcher

一个使用二分搜索来找到最佳配置的迭代搜索器。

after_step()

在递归后更新区间的边界。

Return type:

在搜索之前构建敏感度图,我们用它来近似成本函数。

Return type:

before_step()

检查中间值以确定我们递归的位置。

Return type:

property default_state_dict: Dict[str, Any]

我们还存储了敏感性地图和相关参数。

early_stop()

如果间隔足够小,则提前停止。

Return type:

bool

我们只能在二分搜索中优化某些类型的超参数。

我们只能在二分搜索中优化某些类型的超参数。

load_search_checkpoint()

我们只想在这里加载敏感度地图和原始分数,并保留其余部分。

Return type:

bool

max_degrade: float
middle_value: float
min_degrade: float
original_score: float
sample()

检查我们应该在哪个区间进行递归,并设置相应的子网。

Return type:

Dict[str, Any]

sensitivity_map: Dict[str, Dict[int, float]]
class FastNASPatchManager

基础类: AutoNASPatchManager

FastNAS的补丁管理器(与AutoNAS相同,除了在训练期间不进行采样)。

property sample_during_training

指示我们是否应该在训练期间采样一个新的子网。

convert_fastnas_searchspace(model, config)

使用正确的补丁管理器为FastNAS模式转换搜索空间。

Parameters:
Return type:

元组[模块, 字典[字符串, 任意类型]]

restore_fastnas_searchspace(model, config, metadata)

使用正确的补丁管理器恢复FastNAS模式的搜索空间。

Parameters:
Return type:

模块