• 激活函数matlab代码


    【转自:http://blog.csdn.net/fendoubasaonian/article/details/52974608】
    %JOINT Summary of this function goes here
    %   Detailed explanation goes here
    t1 = linspace(-10,10,500);
    t2 = linspace(-10,10,500);
    t3 = linspace(-10,10,500);
    %    zhx = -12.1*sin(2*pi*(time-0.25))-abs(12.1*sin(2*pi*(time-0.25)));
    %    zhx = 0;
    
    a = 1;
    c = 0;
    % sigmod & tanh
    sigmod = sigmf(t1,[a c])
    tan_h = tanh(t2);
    max_f = max(0,t3);
    
    %激活函数
    subplot(2,2,1);
    plot(t1, sigmod,'r-');
    legend('sigmoid')
    title('sigmoid函数')
    axis([-10, 10, -1, 1])   % 坐标轴的显示范围 
    set(gca, 'XGrid','on');  % X轴的网格
    set(gca, 'YGrid','on');  % Y轴的网格
    
    subplot(2,2,2);
    plot(t2,tan_h,'b-');
    legend('tanh')
    title('tanh函数')
    axis([-10, 10, -1, 1])   % 坐标轴的显示范围 
    set(gca, 'XGrid','on');  % X轴的网格
    set(gca, 'YGrid','on');  % Y轴的网格
    
    subplot(2,2,3);
    plot(t3,max_f,'c-');
    legend('max(0,x)')
    title('max(0,x)函数')
    axis([-10, 10, -10, 10])   % 坐标轴的显示范围 
    set(gca, 'XGrid','on');  % X轴的网格
    set(gca, 'YGrid','on');  % Y轴的网格
  • 相关阅读:
    [译]GLUT教程
    [译]GLUT教程
    [译]GLUT教程
    strlen,_conntof,sizeof
    《const限定符的使用》
    设备资源管理系统-JFreeChart
    设备资源管理系统-jxl报表
    设备资源管理系统-poi报表
    设备资源管理系统-分页
    设备资源管理系统-日志管理
  • 原文地址:https://www.cnblogs.com/beihaidao/p/8178286.html
Copyright © 2020-2023  润新知