recImgP = join(path, "reconstructionImages") htmlPath = join(path, "objects") html = Control.HTMLObjectsView( Reducer, path, createOriginalViewer(origImgP, htmlPath, Reducer, QLSA), createRepresentationViewer(repImgP, htmlPath, Reducer, np.ceil(np.sqrt(r))), createReconstructionViewer(recImgP, htmlPath, Reducer, QLSA), ) html.generate() del html del Reducer I = "/home/jecamargom/tmp/datasets/faces" M, Docs = Control.imagesMatrix(I, 361) DocsP = [join(I, f) for f in Docs] print "[DEBUG] Max number in ORL faces matrix", M.max() print "[DEBUG] Matrix Dimensions : ", M.shape p = "/home/jecamargom/tmp/experiments/faces1" r = 50 # generateFactorization("QLSA",Control.QLSA,M,Docs,DocsP,p,r) generateFactorization("QLSA2", Control.QLSA2, M, Docs, DocsP, p, r, True) # generateFactorization("NMF",Control.NMF,M,Docs,DocsP,p,r) # generateFactorization("VQ",Control.VQ,M,Docs,DocsP,p,r) # generateFactorization("PCA",Control.PCA,M,Docs,DocsP,p,r) p = "/home/jecamargom/tmp/experiments/faces2" r = 25
import Control I = '/home/tuareg/Documents/UNAL/7mo semestre/Machine Learning 2/TMP/datasets/ORLFull' M,L = Control.imagesMatrix(I) M = Control.quantumNormalize(M) quantumImagesDirectory = '/home/tuareg/Documents/UNAL/7mo semestre/Machine Learning 2/TMP/datasets/ORLFullQuantumNormalized/' imageGenerator = Control.imageViewGenerator(M.max(),M.min(),quantumImagesDirectory,quantumImagesDirectory,112,True) for i in range(M.shape[1]): imageGenerator.toImage(M[:,i],L[i])