ltsum.m

来自「ifnn」· M 代码 · 共 26 行

M
26
字号
function output = LTsum(numneurons, icurrent, R, Tmin, Tmax)
% function output = LTsum(numneurons, icurrent, R, Tmin, Tmax)
%
% This function simulates multiplication by linear summation of the output
% of a population of Linear Threshold neurons.  All neurons receive the
% same input current.  Their output is zero while the current value is
% below that neuron's threshold, and above threshold:
% output = R * (current - Ithreshold)
% The thresholds of the neurons are uniformly distributed between Tmin and Tmax
%
% numneurons = number of neurons to simulate
% icurrent = vector of current values to use
% R = constant of proportionality used to calculate the output of
%   above-threshold neurons.
% Tmin = minimum voltage threshold
% Tmax = maximum voltage threshold

% uniformly distributed current thresholds
Its = Tmin + rand(1,numneurons)*(Tmax-Tmin);

clear output
for i=1:length(icurrent)
  whosfiring = icurrent(i) > Its;
  output(i) = sum(whosfiring.*R.*(icurrent(i) - Its));
end

⌨️ 快捷键说明

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