1. 程式人生 > >Memory-Efficient Implementation of DenseNets

Memory-Efficient Implementation of DenseNets

**論文地址:**https://arxiv.org/abs/1707.06990
**pytorch實現:**https://github.com/gpleiss/efficient_densenet_pytorch
**tensorflow實現:**https://github.com/joeyearsley/efficient_densenet_tensorflow

屬於實現方式的改進,不是對網路的改進

對intermediate feature採用共享儲存空間的方式來減低模型視訊記憶體,但是會增加訓練時間,因為需要重新計算一些層的輸出。

之前的卷積網路在Concat和BN操作時都會申請新的記憶體空間,而現在通過提前分配的shared memory storage和指標將這些intermediate feature(concate和BN操作生成的特徵)儲存在temporary storage buffers中,大大減少儲存量。

在GPU視訊記憶體限制的情況下,可以訓練更深的網路,因而效果可更好。
在這裡插入圖片描述

tensorflow實現:
超引數:
–batch_size(int) - 每批影象數(預設為3750)
–fp16(bool) - 是否與FP16一起執行(預設為False)
–efficient(bool) - 是否使用漸變檢查點執行(預設為False)
其中用到了Horovod,Horovod可為使用者實現分散式訓練提供幫助
pytorch實現:
超引數:
可以通過設定引數efficient=True來決定是否共享儲存空間。
–depth (int) - depth of the network (number of convolution layers) (default 40)
–growth_rate (int) - number of features added per DenseNet layer (default 12)
–n_epochs (int) - number of epochs for training (default 300)
–batch_size (int) - size of minibatch (default 256)
–seed (int) - manually set the random seed (default None)

還有以下實現方式:
LuaTorch (by Gao Huang)
MxNet (by Danlu Chen)
Caffe (by Tongcheng Li)
(都是論文作者誒)