⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threshold_fun.m

📁 bnn神经网络
💻 M
字号:
function [value , isterminal , direction] = threshold_fun(t , y)
% THRESHOLD_FUN     Threshold function for spike detection (general)
% 
%   Version:    1.0
%   ----------------------------------
%   Amir Reza Saffari Azar, August 2004
%   amir@ymer.org
%   http://www.ymer.org
%   http://ee.sut.ac.ir/faculty/saffari/main.index

global net

%---setting parameters
if ischar(net.Neurons.SpikeDet.SpikeDetFunParam)
    switch lower(net.Neurons.SpikeDet.SpikeDetFunParam)
        case 'def'
            threshold   = ones(net.Architecture.NeuronNum , 1);
        otherwise
            error('Unknown threshold parameters')
    end
else
    if length(net.Neurons.SpikeDet.SpikeDetFunParam) == 1
        threshold   = net.Neurons.SpikeDet.SpikeDetFunParam*ones(net.Architecture.NeuronNum , 1);
    elseif length(y) ~= length(net.Neurons.SpikeDet.SpikeDetFunParam)
        error('Threshold vector size does not match with the number of neurons')
    else
        threshold   = net.Neurons.SpikeDet.SpikeDetFunParam;
    end
end

%---checking for threshold crossing
value       = y - threshold;
isterminal  = ones(size(y));
direction   = ones(size(y));

return

⌨️ 快捷键说明

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