激活函数总结(十五):振荡系列激活函数补充(SQU、NCU、DSU、SSU)

激活函数总结(十五):激活函数补充
1 引言
2 激活函数
2.1 Shifted Quadratic Unit (SQU) 激活函数
2.2 Non-Monotonic Cubic Unit (NCU) 激活函数
2.3 Decaying Sine Unit (DSU) 激活函数
2.4 Shifted Sinc Unit (SSU) 激活函数
3. 总结
1 引言
在前面的文章中已经介绍了介绍了一系列激活函数 (Sigmoid、Tanh、ReLU、Leaky ReLU、PReLU、Swish、ELU、SELU、GELU、Softmax、Softplus、Mish、Maxout、HardSigmoid、HardTanh、Hardswish、HardShrink、SoftShrink、TanhShrink、RReLU、CELU、ReLU6、GLU、SwiGLU、GTU、Bilinear、ReGLU、GEGLU、Softmin、Softmax2d、Logsoftmax、Identity、LogSigmoid、Bent Identity、Absolute、Bipolar、Bipolar Sigmoid、Sinusoid、Cosine、Arcsinh、Arccosh、Arctanh、LeCun Tanh、TanhExp、Gaussian 、GCU、ASU)。在这篇文章中,会接着上文提到的众多激活函数继续进行介绍,给大家带来更多不常见的激活函数的介绍。这里放一张激活函数的机理图:


最后,对于文章中没有提及到的激活函数,大家可以通过评论指出,作者会在后续的文章中进行添加补充。

2 激活函数
本文提出了四种振荡激活函数(SQU、NCU、DSU、SSU)。振荡激活函数对所有输入都是非饱和的,从而改善了梯度流并加快了收敛速度。使用振荡激活函数代替流行的单调或非单调单零激活函数,能使神经网络训练速度更快,并以更少的层数解决分类问题。

当前该系列振荡激活函数很少使用,较为常用的为GCU和ASU振荡激活函数。。。。

2.1 Shifted Quadratic Unit (SQU) 激活函数
论文链接:Biologically Inspired Oscillating Activation Functions Can Bridge the Performance Gap between Biological and Artificial Neurons

其数学表达式为和数学图像分别如下所示:
f ( x ) = x 2 + x f(x)=x^2+x
f(x)=x 
2
 +x


2.2 Non-Monotonic Cubic Unit (NCU) 激活函数
论文链接:Biologically Inspired Oscillating Activation Functions Can Bridge the Performance Gap between Biological and Artificial Neurons

其数学表达式为和数学图像分别如下所示:
f ( x ) = x − x 3 f(x)=x-x^3
f(x)=x−x 
3
 


2.3 Decaying Sine Unit (DSU) 激活函数
论文链接:Biologically Inspired Oscillating Activation Functions Can Bridge the Performance Gap between Biological and Artificial Neurons

f ( x ) = π ∗ s i n c ( x − π ) f(x)= \pi * sinc(x- \pi )
f(x)=π∗sinc(x−π)


2.4 Shifted Sinc Unit (SSU) 激活函数
论文链接:Biologically Inspired Oscillating Activation Functions Can Bridge the Performance Gap between Biological and Artificial Neurons

f ( x ) = π 2 ∗ ( s i n c ( x − π ) − s i n c ( x + π ) ) f(x)= \frac{\pi}{2} * (sinc(x- \pi ) - sinc(x+ \pi ))
f(x)= 
2
π

 ∗(sinc(x−π)−sinc(x+π))


3. 总结
到此,使用 激活函数总结(十五) 已经介绍完毕了!!! 如果有什么疑问欢迎在评论区提出,对于共性问题可能会后续添加到文章介绍中。如果存在没有提及的激活函数也可以在评论区提出,后续会对其进行添加!!!!

如果觉得这篇文章对你有用,记得点赞、收藏并分享给你的小伙伴们哦😄。
————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                        
原文链接:https://blog.csdn.net/qq_36758270/article/details/132361109

  • 13
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是代码实现: ```c++ #include<iostream> using namespace std; // 定义抽象类Shape class Shape { public: virtual double calArea() = 0; // 纯虚函数 }; // 定义三角形类Triangle class Triangle : public Shape { public: double base, height; Triangle(double b, double h) { base = b; height = h; } double calArea() { return 0.5 * base * height; } }; // 定义矩形类Rectangle class Rectangle : public Shape { public: double length, width; Rectangle(double l, double w) { length = l; width = w; } double calArea() { return length * width; } }; // 定义正方形类Square class Square : public Shape { public: double side; Square(double s) { side = s; } double calArea() { return side * side; } }; // 定义圆形类Circle class Circle : public Shape { public: double radius; Circle(double r) { radius = r; } double calArea() { return 3.14 * radius * radius; } }; // 定义函数fun,输出图形面积 void fun(Shape* s) { cout << "面积为:" << s->calArea() << endl; } void fun(Shape& s) { cout << "面积为:" << s.calArea() << endl; } int main() { // 定义Triangle、Rectangle、Square、Circle类的对象 double b, h, l, w, s, r; cout << "请输入三角形的底和高:" << endl; cin >> b >> h; Triangle tri(b, h); cout << "请输入矩形的长和宽:" << endl; cin >> l >> w; Rectangle rec(l, w); cout << "请输入正方形的边长:" << endl; cin >> s; Square squ(s); cout << "请输入圆形的半径:" << endl; cin >> r; Circle cir(r); // 分别调用fun函数输出各种图形的面积 cout << "通过指针调用fun函数输出各种图形的面积:" << endl; fun(&tri); fun(&rec); fun(&squ); fun(&cir); cout << "通过引用调用fun函数输出各种图形的面积:" << endl; fun(tri); fun(rec); fun(squ); fun(cir); return 0; } ``` 运行结果: ``` 请输入三角形的底和高: 4 6 请输入矩形的长和宽: 3 5 请输入正方形的边长: 2 请输入圆形的半径: 4 通过指针调用fun函数输出各种图形的面积: 面积为:12 面积为:15 面积为:4 面积为:50.24 通过引用调用fun函数输出各种图形的面积: 面积为:12 面积为:15 面积为:4 面积为:50.24 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值