当前位置:网站首页>NMF-matlab
NMF-matlab
2022-07-02 19:42:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
matlab Practice the program ( Nonnegative matrix decomposition )
The algorithm is Lee and Seung stay 1999 Years published in nature In the magazine . See the specific paper here :http://www.seas.upenn.edu/~ddlee/Papers/nmf.pdf.
It doesn't matter if you don't understand English , You can see this introduction in Chinese :http://wenku.baidu.com/view/94c8af0bf78a6529647d5331.html.
The principle of the above two articles has been very clear , I'm introducing it according to my own understanding .
Usually, matrix decomposition is as follows svd Or any other decomposition will decompose the matrix into positive and negative matrices , And his decomposition method completely decomposes the matrix into a matrix with only positive numbers , Because in the real world, such as images , Negative numbers are meaningless , So this decomposition method that only decomposes into positive matrix is very meaningful , Otherwise, it will not be sent in nature Such a cow B In my magazine .
Here is the formula of decomposition :
here r Is the rank of the decomposition matrix ,V Is an approximation of the original matrix ,W And H Is the decomposition of two matrices .
Here is W and H The way of seeking , It's an iterative algorithm , Initial W And H It's random :
About the code , I learned from this blog :http://fxy1211.blog.163.com/blog/static/68255322007826111015905/, Thank you so much for this blogger .
Here is the code :
clear all; close all; clc; V=double(imread('lena.jpg')); imshow(mat2gray(V)); [i u]=size(V); % Calculation V Specifications r=100; % Set the rank of the decomposition matrix W=rand(i,r); % initialization WH, It's a nonnegative number H=rand(r,u); maviter=100; % Maximum number of iterations for iter=1:maviter W=W.*((V./(W*H))*H'); % Note that the three formulas here correspond to those in the text
W=W./(ones(i,1)*sum(W)); H=H.*(W'*(V./(W*H)));
end img_V=W*H; figure; imshow(mat2gray(img_V));
The following is the original image and the reconstructed effect , If the number of rank sum iterations is greater , Then the reconstructed graph is closer to the original graph :
Original picture
Reconstruction graph
Because this is based on my related direction. I happened to see this algorithm in the quotation of a paper , So I got a little understanding , There must be something wrong , be it so .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/148571.html Link to the original text :https://javaforall.cn
边栏推荐
- zabbix5客户端安装和配置
- 数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
- What is the MySQL backup suffix_ MySQL backup restore
- How to set priorities in C language? Elaborate on C language priorities
- Introduction to mongodb chapter 03 basic concepts of mongodb
- 452-strcpy、strcat、strcmp、strstr、strchr的实现
- Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
- checklistbox控件用法总结
- Kt148a voice chip IC user end self replacement voice method, upper computer
- Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
猜你喜欢
450-深信服面经1
Istio1.12:安装和快速入门
数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
AcWing 1126. Minimum cost solution (shortest path Dijkstra)
字典
Génération automatique de fichiers d'annotation d'images vgg
JASMINER X4 1U深度拆解,揭开高效省电背后的秘密
AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)
Build a master-slave mode cluster redis
Kt148a voice chip IC software reference code c language, first-line serial port
随机推荐
R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线(indifference curve)
Bubble sort array
Think about the huge changes caused by variables
Design and implementation of ks004 based on SSH address book system
Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode
4274. 后缀表达式-二叉表达式树
AcWing 1126. 最小花费 题解(最短路—dijkstra)
ShardingSphere-JDBC5.1.2版本关于SELECT LAST_INSERT_ID()本人发现还是存在路由问题
定了,就是它!
AcWing 1135. 新年好 题解(最短路+搜索)
How to avoid duplicate data in gaobingfa?
Notes on hardware design of kt148a voice chip IC
KT148A语音芯片使用说明、硬件、以及协议、以及常见问题,和参考代码
KT148A语音芯片ic的开发常见问题以及描述
Introduction of Ethernet PHY layer chip lan8720a
450-深信服面经1
Use IDM to download Baidu online disk files (useful for personal testing) [easy to understand]
Correspondence between pytoch version, CUDA version and graphics card driver version
RPD product: super power squad nanny strategy
AcWing 383. Sightseeing problem solution (shortest circuit)