Esempio n. 1
0
 def projectL(self, L):
     if L.ndim == 3:
         pL = np.zeros(L.shape,"float")
         for i in range(L.shape[2]):
             pL[...,i] = utils.project_simplex(L[...,i], self.I0_sum[i])
         return pL
     else:
         return utils.project_simplex(L, self.I0_sum)
Esempio n. 2
0
 def projectL(self, L):
     if L.ndim == 3:
         pL = np.zeros(L.shape, "float")
         for i in range(L.shape[2]):
             pL[..., i] = utils.project_simplex(L[..., i], self.I0_sum[i])
         return pL
     else:
         return utils.project_simplex(L, self.I0_sum)
Esempio n. 3
0
    def projectP(self, P):
#~ 
        #~ pcut = P.max() * self.cutoff
        #~ if pcut <0 :
            #~ raise ValueError("P was all negative!")
        #~ P = P * (P > pcut)
        #~ P /= P.sum()
        #~ return P
        return utils.project_simplex(P)
Esempio n. 4
0
 def projectP(self, P):
     #~
     #~ pcut = P.max() * self.cutoff
     #~ if pcut <0 :
     #~ raise ValueError("P was all negative!")
     #~ P = P * (P > pcut)
     #~ P /= P.sum()
     #~ return P
     return utils.project_simplex(P)
Esempio n. 5
0
 def projectXP(self, X):
     return utils.project_simplex(X)
Esempio n. 6
0
 def projectXP(self, X):
     return utils.project_simplex(X)