tansigtf_snn.m
来自「神经网络的工具箱, 神经网络的工具箱,」· M 代码 · 共 50 行
M
50 行
function f = tansigtf_snn(x)%TANSIGTF_SNN Tan sigmoid transfer function.%% Syntax%% f = tansigtf_snn(x)%% x - input. % f - output for transfer function.%% Description%% TANSIGTF_SNN is a transfer function. Transfer functions% calculate a layer's output from its net input.%% TANSIGTF_SNN(x) takes one input,% x - net input% and returns % f - tanh(x). %% TANSIGTF_SNN(CODE) returns useful information for each CODE string:% 'deriv' - Returns name of derivative function.%% See also%% DTANSIGTF_SNN%% This function is a substitute for TANSIG from Matlab's NN Toolbox. if nargin < 1, error('Not enough arguments.'); endif isstr(x) switch (x) case 'version' f = 3.0; % <-- Must be 3.0. (can be used in matlabs % Neural network toolbox) case 'deriv' f = 'dtansigtf_snn'; case 'output' f = [-1 1]; case 'active' f = [-2 +2]; otherwise, error('Unrecognized code.') endelse f = 2 ./ (1 + exp(-2*x)) - 1; end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?