当前位置:网站首页>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 1131. Saving Private Ryan (the shortest way)
- AcWing 383. 观光 题解(最短路)
- 安装单机redis详细教程
- Mobile robot path planning: artificial potential field method [easy to understand]
- AcWing 342. 道路与航线 题解 (最短路、拓扑排序)
- Istio部署:快速上手微服务,
- 4274. Suffix expression - binary expression tree
- Correspondence between pytoch version, CUDA version and graphics card driver version
- Watchful pioneer world outlook Architecture - (how does a good game come from)
- R语言使用econocharts包创建微观经济或宏观经济图、indifference函数可视化无差异曲线(indifference curve)
猜你喜欢

Registration opportunity of autowiredannotationbeanpostprocessor in XML development mode

Common problems and description of kt148a voice chip IC development

编写完10万行代码,我发了篇长文吐槽Rust

SQLite 3.39.0 release supports right external connection and all external connection

What is the Bluetooth chip ble, how to select it, and what is the path of subsequent technology development

Watchful pioneer world outlook Architecture - (how does a good game come from)

Notes on hardware design of kt148a voice chip IC

Introduction to program ape (XII) -- data storage

良心总结!Jupyter Notebook 从小白到高手,保姆教程来了!

安装单机redis详细教程
随机推荐
SIFT feature point extraction "suggestions collection"
R language uses econcharts package to create microeconomic or macroeconomic maps, and indifference function to visualize indifference curve
Automatically generate VGg image annotation file
AcWing 1128. Messenger solution (shortest path Floyd)
Getting started with typescript
Registration opportunity of autowiredannotationbeanpostprocessor under annotation development mode
《架构整洁之道》读书笔记(下)
Data Lake (XII): integration of spark3.1.2 and iceberg0.12.1
数据湖(十二):Spark3.1.2与Iceberg0.12.1整合
高并发下如何避免产生重复数据?
多端小程序开发有什么好处?覆盖百度小程序抖音小程序微信小程序开发,抢占多平台流量红利
Which video recording software is better for the computer
编写完10万行代码,我发了篇长文吐槽Rust
RPD product: super power squad nanny strategy
Typescript 之 快速入门
Zabbix5 client installation and configuration
Introduction to mongodb chapter 03 basic concepts of mongodb
Solution: vs2017 cannot open the source file stdio h main. H header document [easy to understand]
Reading notes of "the way to clean structure" (Part 2)
自動生成VGG圖像注釋文件