dmexican_hat.m

来自「利用遗传算法优化BP神经网络 即用遗传算法代替BP网络中的训练函数」· M 代码 · 共 32 行

M
32
字号
function d = dmexican_hat(n,a)
%MYDTF Example custom transfer derivative function of MYTF.
%
%  Use this function as a template to write your own function.
%  
%  Syntax
%
%    dA_dN = mydtf(N,A)
%      N - SxQ matrix of Q net input (column) vectors.
%      A - SxQ matrix of Q output (column) vectors.
%      dA_dN - SxQ derivative dA/dN.
%
%  Example
%
%    n = -5:.1:5;
%    a = dmexican_hat(n);
%    da_dn = dmexican_hat(n,a);
%    subplot(2,1,1), plot(n,a)
%    subplot(2,1,2), plot(n,da_dn)

% Copyright 1997 The MathWorks, Inc.
% $Revision: 1.2.2.1 $

% **  Replace the following calculation with your
% **  derivative calculation.

 d = -2*n.*exp(-1/2*n.^2)-a.*n;

% **  Note that you have both the transfer functions input N and
% **  output A available, which can often allow a more efficient
% **  calculation of the derivative than with just N.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?