论文链接:https://arxiv.org/pdf/2007.11824.pdf
官方代码:GitHub - megvii-model/FunnelAct
paddle复现版本:FReLU:简单高效的新型激活函数 - 飞桨AI Studio
torch复现版本:GitHub - nekitmm/FunnelAct_Pytorch: pytorch implementation of Funnel Activation (FReLU)
import torch
import torch.nn as nn
class FReLU(nn.Module):
r""" FReLU formulation. The funnel condition has a window size of kxk. (k=3 by default)
"""
def __init__(self, in_channels):
super().__init__()
self.conv_frelu = nn.Conv2d(in_channels, in_channels, kernel_size = 3, stride = 1, padding = 1, groups = in_channels)
self.bn_frelu = nn.BatchNorm2d(in_channels)
def forward(self, x):
y = self.conv_frelu(x)
y = self.bn_frelu(y)
x = torch.max(x, y)
return x
这个图非常清晰的解释了ReLU、PReLU、FReLU三者的区别,所以论文可以不用看了
论文效果
轻量网络对比
技巧:
- 1:目标检测任务
Apply FReLU to YOLOv5 · Issue #2 · megvii-model/FunnelAct · GitHub
- 2:人脸识别任务
但也有反馈在人脸识别任务中效果不好:个人觉得应该多试试
如何评价旷视和港中大提出的FReLU(ECCV2020)? - 知乎
经验:
- 1:使用位置:网络的浅层
- 2:逐步替换:直到overfitting
- 3:初始化方式
- 4:过拟合问题
- Strategies to avoid overfitting · Issue #5 · megvii-model/FunnelAct · GitHub
- 5:学习率设置:Just use the simple linear decay schedule
参考文献:
1:https://blog.csdn.net/m0_63642362/article/details/126236829