欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Matlab画**函数sigmoid, tanh,Relu等

程序员文章站 2022-05-22 11:19:51
...
        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轴的网格
      

 

Matlab画**函数sigmoid, tanh,Relu等

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轴的网格
      

 

Matlab画**函数sigmoid, tanh,Relu等

 

相关标签: 深度学习