knitr::opts_chunk$set(echo = TRUE) knitr::read_chunk("pnmf_face_trials.R")
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")
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:
Select a random 16 faces and display them - prove that they really are faces. Note that there is some inverting in the plotting commands
ICA and SVD seeds
Random seeds
Offset method (Badea, 2009, modification to Lee and Seung)
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.
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.
What does the reconstruction look like from 20 components?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.