非负矩阵分解代码

更新时间:2023-06-10 07:44:21 阅读: 评论:0

function [W,H] = nmf(V,Winit,Hinit,tol,timelimit,maxiter)
% NMF by alternative non-negative least squares using projected gradients
% Author: Chih-Jen Lin, National Taiwan University
% W,H: output solution 输出结果
% Winit,Hinit: initial solution
% tol: tolerance for a relative stopping condition
% timelimit, maxiter: limit of time and iterations
毒蛇排名W = Winit; H = Hinit; initt = cputime;
儿童动画片排行榜
gradW = W*(H*H’) - V*H’;
gradH = (W’*W)*H - W’*V;
initgrad = norm([gradW; gradH’],’fro’);
fprintf(’Init gradient norm %f\n’, initgrad);
tolW = max(0.001,tol)*initgrad; tolH = tolW;
for iter=1:maxiter,
冷锋和暖锋示意图% stopping condition
projnorm = norm([gradW(gradW<0 | W>0); gradH(gradH<0 | H>0)]);能谋善断
if projnorm < tol*initgrad | cputime-initt > timelimit,
break;
end深圳市物价局
[W,gradW,iterW] = nlssub prob(V’,H’,W’,tolW,1000); W = W’; gradW = gradW’; if iterW==1,
tolW = 0.1 * tolW;
end
[H,gradH,iterH] = nlssubprob(V,W,H,tolH,1000);跨行存款要手续费吗>为什么刘畊宏突然爆火
if iterH==1,
tolH = 0.1 * tolH;
end
if rem(iter,10)==0, fprintf(’.’); end
从的组词
end
fprintf(’\nIter = %d Final proj-grad norm %f\n’, iter, projnorm);

本文发布于:2023-06-10 07:44:21,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1031894.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图