knitr::opts_chunk$set(echo = TRUE)
knitr::read_chunk("pnmf_face_trials.R")

Trials of the various PNMF functions

Idea is to test out the various initialization/seeding options and confirm that each variation is behaving sensibly. The test set will be a face dataset, as the expected components are easy to interpret.

Expect the document to take a long time to run.

Note - NMF installed from github:

devtools::install_github("richardbeare/NMF", ref="ArrayWarning")

Setup

Register the non-core methods (i.e. ones that don't come with NMF) so that they work in the NMF framework. Load the face data.


The following NMF tools are available:


Check the faces

Select a random 16 faces and display them - prove that they really are faces. Note that there is some inverting in the plotting commands


Run some established methods

ICA and SVD seeds


Random seeds


Offset method (Badea, 2009, modification to Lee and Seung)


Brunet, ICA seed


Brunet, nonnegative double singular value decomposition


Brunet, random seed, 20 runs


Offset, ICA seed


Offset, nonnegative double singular value decomposition


Offset, random seed, 20 runs


Projective methods




PNMF plots




PNMFO plots




PNMFKL plots




Summary so far

Classical methods very dependent on seed choice. Some of the results look a bit crap.

We'd like to avoid the random methods - need lots of repeats.

ICA messes up some time.

NNDSVD so far has used the default method, which does not "densify". Test a couple of the methods with the "average" option. Avoid the "random" option.

PNMF with average densify



Finally - rank selection

Note that I've used a hacked version of NMF to parallelise rank selection. Normally the parallel part is within multiple runs, i.e. for random seeding, which we're trying to avoid.




Face compression

What does the reconstruction look like from 20 components?



richardbeare/pNMF documentation built on June 30, 2020, 6:33 p.m.