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

📄 kohonen_check.m

📁 this file is leverage algorithm written in matlab as m-file and tested in matlab.so anyone can ue th
💻 M
字号:
function errortype = kohonen_check(X,settings,model,type)

% multiple checks for kohonen inputs
%
% see the HTML HELP files (help.htm) for details 

errortype = 'none';
switch type
    
    case {'model'}
        errortype = check_data(X,errortype);
        errortype = check_settings(settings,errortype);
                
    case {'pred'}
        errortype = check_layer(X,model,errortype);

end

% -------------------------------------------------------------------------

function errortype = check_data(X,errortype)

% data structure
if  ndims(X) < 2 | ndims(X) > 2                 
    errortype = 'input error: wrong data structure, data must be a 2 way data matrix';
    return
end

% -------------------------------------------------------------------------

function errortype = check_settings(settings,errortype)

if  isnan(settings.nsize)                 
    errortype = 'input error: the map size (settings.nsize) is not defined in the setting structure';
    return
end

if  isnan(settings.epochs)                 
    errortype = 'input error: the number of epochs (settings.epochs) is not defined in the setting structure';
    return
end

% -------------------------------------------------------------------------

function errortype = check_layer(X,model,errortype)

if  size(X,2) ~= size(model.net.W,3)                 
    errortype = 'input error: the number of variables (columns) in X are different with respect to the number of layers in the model';
    return
end

⌨️ 快捷键说明

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