前言
上一篇文章 AI实战:深度学习模型压缩:模型裁剪——Pruning with Tensorflow 介绍了使用Tensorflow裁剪模型的方法,本文继续介绍使用Keras裁剪模型的方法及源码分享。
模型裁剪
1、《Train sparse TensorFlow models with Keras》 【TF官网方法】
核心思想:对neural network’s weight tensors进行pruning
论文:To prune, or not to prune: exploring the efficacy of pruning for model compression (https://arxiv.org/abs/1710.01878)
主要内容:
github地址:https://github.com/tensorflow/model-optimization/tree/master/tensorflow_model_optimization/g3doc/guide/pruning
官方给出的实现例子:https://github.com/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/pruning/pruning_with_keras.ipynb
2、《Ridurre - Filter Pruning in Deep Convolutional Networks》
核心思想:对convolutional filter进行pruning
论文:Filter Level Pruning Based on Similar Feature Extraction for Convolutional Neural Networks(https://www.jstage.jst.go.jp/article/transinf/E101.D/4/E101.D_2017EDL8248/_pdf)
Demystifying Neural Network Filter Pruning( https://openreview.net/pdf?id=rJffBWBtoX )
主要内容如下:
github地址:https://github.com/gaborvecsei/Ridurre-Network-Filter-Pruning-Keras