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

📄 mfbox_past.m

📁 toolbox for spm 5 for data, model free analysis
💻 M
字号:
function W=mfbox_past(X,n,beta,numits,verbose)% Copyright by Peter Gruber, Fabian J. Theis% Signal Processing & Information Theory group% Institute of Biophysics, University of Regensburg, Germany% Homepage: http://research.fabian.theis.name%           http://www-aglang.uni-regensburg.de%% This file is free software, subject to the % GNU GENERAL PUBLIC LICENSE, see gpl.txt%% mfbox_past - a neural PCA / subspace algorithm%% X         data set% n         reduced dimension% beta      forgetting factor (1:dont forget, ~0: forget nearly everything before)% numits    number of iterations (if numits is larger than sample size, the algorithm starts from the beginning again)%% W         trained subspace projection matrix%% 18.11.2004 Fabian Theis (fabian@theis.name)%% Reference:% B. Yang. Projection approximation subspace tracking. IEEE Trans. on Signal Processing, 43(1):95-107, 1995.error(nargchk(2,5,nargin))     % check no. of input argsif (nargin<3) beta = 0.5; endif (nargin<4) numits = 1000; endif (nargin<5) verbose = 0; end[m T] = size(X);W = eye(n,m);P = eye(n);cost = [];for i=1:numits    b = ((numits-i)*beta+i)/numits;    x = X(:,mod(i-1,T)+1);    y = W*x;    h = P*y;    m = h/(b+y'*h);    P = triu(P-m*h');    P = 1/b*(P+P'-diag(diag(P)));    e = x-W'*y;    dW = m*e';    W = W+dW;    cost(i) = norm(dW,'fro');    if ((verbose>0)&&(mod(i,floor(numits/20))==0))        plot(gca,1:i,cost); set(gca,'YScale','log'); drawnow; title(gca,'Change per iteration');    endendreturn

⌨️ 快捷键说明

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