非负矩阵分解代码

更新时间:2023-06-25 02:55:00 阅读: 评论: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 输出结果
first name% Winit,Hinit: initial solution
% tol: tolerance for a relative stopping condition
% timelimit, maxiter: limit of time and iterations
西餐礼仪英语>epoch>英文书名W = Winit; H = Hinit; initt = cputime;
gradW = W*(H*H’) - V*H’;
gradH = (W’*W)*H - W’*V;
contaxinitgrad = norm([gradW; gradH’],’fro’);
fireball
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;
endblur
[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);slideunlock
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-25 02:55:00,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/156690.html

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

标签:输出   西餐   结果   礼仪
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图