SE Block (Sequeze and Excitation)

 

 

 

看senet block的代码,明白如何实现

def Squeeze_excitation_layer(self, input_x, out_dim, ratio, layer_name):
    with tf.name_scope(layer_name) :
        squeeze = Global_Average_Pooling(input_x)#对每个通道取全局最大化
        excitation = Fully_connected(squeeze, units=out_dim / ratio, layer_name=layer_name+'_fully_connected1')
        excitation = Relu(excitation)
        #为什么用两个全卷基层, 而且为什么卷基层的unit不同?
        excitation = Fully_connected(excitation, units=out_dim, layer_name=layer_name+'_fully_connected2')
        excitation = Sigmoid(excitation)
        excitation = tf.reshape(excitation, [-1,1,1,out_dim])
        scale = input_x * excitation
        return scale

 为什么用两个全卷基层, 而且为什么卷基层的unit不同?

(1) 用两个全连接层,因为一个全连接层无法同时应用relu和sigmoid两个非线性函数,但是两者又缺一不可。

(2) 为了减少参数,所以设置了r比率。(论文中取的是16)

作者在准确率和参数量之间取了一个折中,r = 16.

 

 

参考

(1)[DL-架构-ResNet系] 007 SENet https://zhuanlan.zhihu.com/p/29708106

(2)【深度学习从入门到放弃】Squeeze-and-Excitation Networks https://zhuanlan.zhihu.com/p/29812913

  • 6
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值