loadwholekernel.m.svn-base

来自「a function inside machine learning」· SVN-BASE 代码 · 共 25 行

SVN-BASE
25
字号
function fileK = loadWholeKernel(X1Indices, X2Indices, kernelParams)
%Loads a kernel saved as a single variable from a file. 
%X1Indices indexes the rows, X2Indices indexes columns 
fileName = char(kernelParams.kernelFileName); 
kernelName = char(kernelParams.kernelName); 

fprintf('Loading kernel ... '); 
load(fileName, kernelName);
fprintf('... all done.\n'); 

renvar(kernelName, 'fileK'); 
numX1Examples = size(fileK, 1);
numX2Examples = size(fileK, 2);

%Check indices are within range 
if length(find(X1Indices > numX1Examples | X1Indices < 1))~= 0 
    error('X1Indices must between 1 and %d', numX1Examples); 
end 

if length(find(X2Indices > numX2Examples | X2Indices < 1))~= 0 
    error('X2Indices must between 1 and %d', numX2Examples); 
end 

fileK = fileK(X1Indices, X2Indices); 

⌨️ 快捷键说明

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