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

📄 art_activate_categories.m

📁 ART 神经网络Matlab代码。包括数据产生函数
💻 M
字号:
function categoryActivation = ART_Activate_Categories(input, weight, bias)
% ART_Activate_Categories    Activates the categories in an ART network.
%    CATEGORYACTIVATION = ART_Activate_Categories(INPUT, WEIGHT, BIAS)
%    This function returns a vector of category activations for the given
%    input vector, weight matrix, and bias value.
% 
%    The input parameters are as follows:
%    The INPUT is a vector of size NumFeatures that contains the input
%    signal into the network. The WEIGHT is a matrix of size 
%    NumFeatures-by-NumCategories which holds the weights of the network.
%    The BIAS is the constant that is used to differentiate between very
%    similar category activation values. The length of the INPUT vector
%    must equal the number of rows in the WEIGHT matrix, and the BIAS
%    value must be within the range [0, 1] (although values very near
%    0 are best).
%
%    The return parameter is as follows:
%    The CATEGORYACTIVATION is a vector of size NumCategories that
%    holds the activation value for each category.


% Make sure the user supplied the required parameters.
if(nargin ~= 3)
    error('You must specify the 3 input parameters.');
end

% Check the size and range of the parameters.
[numFeatures, numCategories] = size(weight);
if(length(input) ~= numFeatures)
    error('The length of the input and rows of the weights do not match.');
end
if((bias < 0) | (bias > 1))
    error('The bias must be within the range [0, 1].');
end

% Set up the return variable.
categoryActivation = ones(1, numCategories);

% Calculate the activation for each category.
% This is done according to the following equation:
%        Activation(j) = |Input^Weight(j)| / (bias + |Weight(j)|)
for j = 1:numCategories    
    matchVector = min(input, weight(:, j));
    weightLength = sum(weight(:, j));
    categoryActivation(1, j) = sum(matchVector) / (bias + weightLength);
end


return

⌨️ 快捷键说明

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