当前位置:网站首页>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
边栏推荐
- AcWing 1137. 选择最佳线路 题解(最短路)
- MySQL table historical data cleaning summary
- AcWing 1127. 香甜的黄油 题解(最短路—spfa)
- Golang并发编程——goroutine、channel、sync
- 使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
- AcWing 1126. Minimum cost solution (shortest path Dijkstra)
- Use IDM to download Baidu online disk files (useful for personal testing) [easy to understand]
- Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
- 字典
- A4988 drive stepper motor "recommended collection"
猜你喜欢

Kt148a voice chip IC user end self replacement voice method, upper computer

End to end object detection with transformers (Detr) paper reading and understanding

Kt148a voice chip instructions, hardware, protocols, common problems, and reference codes

rxjs Observable 自定义 Operator 的开发技巧

IDEA编辑器去掉sql语句背景颜色SQL语句警告No data sources are configured to run this SQL...和SQL Dialect is Not Config

Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly

Set up sentinel mode. Reids and redis leave the sentinel cluster from the node

Educational codeforces round 129 (rated for Div. 2) supplementary problem solution

JASMINER X4 1U深度拆解,揭开高效省电背后的秘密

KT148A语音芯片ic的用户端自己更换语音的方法,上位机
随机推荐
搭建主从模式集群redis
《架构整洁之道》读书笔记(下)
Watchful pioneer world outlook Architecture - (how does a good game come from)
AcWing 1126. Minimum cost solution (shortest path Dijkstra)
多态的理解以及作用
蓝牙芯片ble是什么,以及该如何选型,后续技术发展的路径是什么
AcWing 1137. 选择最佳线路 题解(最短路)
Codeworks round 802 (Div. 2) pure supplementary questions
AcWing 1127. 香甜的黄油 题解(最短路—spfa)
AcWing 903. 昂贵的聘礼 题解(最短路—建图、dijkstra)
字典
AcWing 1129. 热浪 题解(最短路—spfa)
Postman下载安装
JASMINER X4 1U深度拆解,揭开高效省电背后的秘密
Postman download and installation
Getting started with typescript
Notes on hardware design of kt148a voice chip IC
Zabbix5 client installation and configuration
AcWing 1126. 最小花费 题解(最短路—dijkstra)
c语言里怎么设立优先级,细说C语言优先级