diff cnmf.py @ 7:294f66d285af

some previous changes
author mitian
date Tue, 05 May 2015 08:54:09 +0100
parents 56a2ca9359d0
children 915c849b17ea
line wrap: on
line diff
--- a/cnmf.py	Thu Apr 09 19:22:39 2015 +0100
+++ b/cnmf.py	Tue May 05 08:54:09 2015 +0100
@@ -18,6 +18,12 @@
 # Local stuff
 from utils import SegUtil
 
+# Algorithm params
+h = 8               # Size of median filter for features in C-NMF
+R = 15              # Size of the median filter for the activation matrix C-NMF
+rank = 4            # Rank of decomposition for the boundaries
+rank_labels = 6     # Rank of decomposition for the labels
+R_labels = 6        # Size of the median filter for the labels
 
 def cnmf(S, rank, niter=500):
     """(Convex) Non-Negative Matrix Factorization.
@@ -88,7 +94,7 @@
     return G.flatten()
 
 
-def segmentation(X, rank, R, h, niter=300):
+def segmentation(X, rank=4, R=15, h=8, niter=300):
     """
     Gets the segmentation (boundaries and labels) from the factorization
     matrices.
@@ -138,4 +144,4 @@
         else:
             break
 
-    return bound_idxs
+    return G, bound_idxs