我是靠谱客的博主 疯狂小白菜,这篇文章主要介绍Matlab画激活函数sigmoid, tanh,Relu等,现在分享给大家,希望可以做个参考。

        x = linspace(-10.0,10.0);
relu = max(x,0);
sigmoid = 1./(1.0+exp(-1.0*x));
tanh = 2./(1.0 + exp(-2.0 * x)) - 1;


plot(x,relu,'r');
hold on;
plot(x,sigmoid,'b');
hold on;
plot(x,tanh,'g');

legend('relu','sigmoid','tanh');
title('激活函数(Activation)','FontSize',16);

hold on;
y = linspace(-2.0,5.0);
x = 0.*y;
plot(x,y,'k')
axis([-2.0 5.0 -2.0 5.0])
set(gca, 'XGrid','on');  % X轴的网格
set(gca, 'YGrid','on');  % Y轴的网格
      

 

v2-bdbac6c4a165fb9374af480fb8155d81_b.jpg

ReLu 与 TLU

        x = linspace(-10.0,10.0);
relu = max(x,0);
tlu = max(x-1,0)+1

plot(x,relu,'r');
hold on;
plot(x,tlu,'b');
hold on;

legend('relu','tlu');
title('激活函数(Activation)','FontSize',16);
hold on;

y = linspace(-2.0,5.0);
x = 0.*y;
plot(x,y,'k')
axis([-2.0 5.0 -2.0 5.0])
set(gca, 'XGrid','on');  % X轴的网格
set(gca, 'YGrid','on');  % Y轴的网格
      

 

v2-87ff795599c363eec7d404a6ce96762d_b.jpg

 

最后

以上就是疯狂小白菜最近收集整理的关于Matlab画激活函数sigmoid, tanh,Relu等的全部内容,更多相关Matlab画激活函数sigmoid,内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(151)

评论列表共有 0 条评论

立即
投稿
返回
顶部