主要内容

剪枝

R2026b
通过对卷积层中最不重要的滤波器进行剪枝,减少神经网络中的可学习参数的数量

剪枝通过删除卷积层中最不重要的滤波器来减少神经网络中的可学习参数的数量。

如果可以使用 trainnet 函数训练网络,则使用 compressNetworkUsingTaylorPruning 函数对网络进行剪枝。如果无法使用 trainnet 函数训练网络,则改用 taylorPrunableNetwork 对象来创建自定义剪枝循环。

有关 Deep Learning Toolbox™ Model Compression Library 中提供的压缩技术的详细概述,请参阅Reduce Memory Footprint of Deep Neural Networks。

Simplified illustration of pruning. On the left is a sketch of a neural network with three layers that consist of four, three, and four neurons, respectively. All neurons are connected to all other neurons. An arrow points to a second sketch on the right that shows the same network, but one neuron has been cut out from the middle layer, and two neurons have been cut out from the final layer.

函数

全部展开

compressNetworkUsingTaylorPruningCompress neural network using Taylor pruning (自 R2026a 起)
taylorPrunableNetworkNeural network suitable for compression using Taylor pruning (自 R2022a 起)
forward计算深度学习网络输出以进行训练
predict计算深度学习网络输出以进行推断
updatePrunablesRemove filters from prunable layers based on importance scores (自 R2022a 起)
updateScoreCompute and accumulate Taylor-based importance scores for pruning (自 R2022a 起)

主题

精选示例