📄 tansigtf_snn.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -