필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

what is the answer for this code ?

조회 수: 1 (최근 30일)
nirai selvi
nirai selvi 2015년 10월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
function K = rbf(coord,sig)
%function K = rbf(coord,sig) % % Computes an rbf kernel matrix from the input coordinates % %INPUTS % coord = a matrix containing all samples as rows % sig = sigma, the kernel width; squared distances are divided by % squared sig in the exponent % %OUTPUTS % K = the rbf kernel matrix ( = exp(-1/(2*sigma^2)*(coord*coord')^2) ) % % % For more info, see www.kernel-methods.net
% %Author: Tijl De Bie, february 2003. Adapted: october 2004 (for speedup).
n=size(coord,1); K=coord*coord'/sig^2; d=diag(K); K=K-ones(n,1)*d'/2; K=K-d*ones(1,n)/2; K=exp(K);
%% Previous version: %% % n = size(coord,1); % for i=1:n % K(i,i)=1; % for j=1:i-1 % K(i,j)=exp(-norm(coord(i,:)-coord(j,:))^2/sig^2);% Should be % % 2*sig^2! % K(j,i)=K(i,j); % end % end

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by