Skip to content

ngrupen/nmf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nmf

Implementation of non-negative matrix factorization on an image dataset via multiplicative updates.

Currently assumes use of CelebA dataset, update IMG_H and IMG_W globals for other datasets.

nmf.py

Runs non-negative matrix factorization according to the following command line arguments:

  • num_imgs = number of input images to use from dataset.
  • itrs = number of iterations.
  • k = factorization rank. Note: larger k pays more accurate reconstructions with longer compute times.
  • fp = filepath to your dataset. For the CelebA dataset, point this to the "img_align_celeba" folder.

Example Run: python nmf.py --num_imgs 4000 --itrs 1000 --k 99 --fp ../data/img_align_celeba

display_mat.py

Displays a sample image, basis vectors, weights, and image reconstructions. The following commands are available:

  • num_imgs = number of input images to use from dataset.
  • fp = filepath to your dataset. For the CelebA dataset, point this to the "img_align_celeba" folder.

Example Run: python display_mat.py --num_imgs 4000 --fp ../data/img_align_celeba

References

  1. D. D. Lee and H. S. Seung, “Algorithms for non-negative matrix factorization”

  2. N. Gillis, “The Why and How of Nonnegative Matrix Factorization”

About

Non-negative Matrix Factorization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages