通道稀疏或4选2结构化稀疏接口,两种稀疏特性每次只能使能一个:
无。
create_prune_retrain_model(graph, outputs, record_file, config_defination)
参数名 |
输入/返回值 |
含义 |
使用限制 |
---|---|---|---|
graph |
输入 |
用户传入的待稀疏模型的tf.Graph图。 |
数据类型:tf.Graph |
outputs |
输入 |
用户模型的输出。 |
数据类型:list,列表中元素类型为string,例如[output1,output2,...]。 |
record_file |
输入 |
记录稀疏信息的文件路径及名称,记录通道稀疏结点间的级联关系或记录4选2稀疏的节点。 |
数据类型:string |
config_defination |
输入 |
用户提供的稀疏配置文件,用于指定模型tf.Graph图中各层稀疏配置情况。 基于retrain_config_tf.proto文件生成的简易配置文件prune.cfg,retrain_config_tf.proto文件所在路径为:AMCT安装目录/amct_tensorflow/proto/retrain_config_tf.proto。 retrain_config_tf.proto文件参数解释以及生成的prune.cfg稀疏配置文件样例请参见量化感知训练简易配置文件。 |
数据类型:string |
无
无。
1 | amct.create_prune_retrain_model(graph, [operation_name_1, operation_name_2], './tmp/record.txt', './tmp/sample_prune.cfg') |