def objective(self,data):
        """
        compute objective function F(U,V)

        params:
          data: scipy csr sparse matrix containing user->(item,count)
          U   : user factors
          V   : item factors
          lbda: regularization constant lambda
        returns:
          current value of F(U,V)
        """
        F = -0.5*self.lbda*(np.sum(self.U*self.U)+np.sum(self.V*self.V))
        for i in xrange(len(self.U)):
            f = self.precompute_f(data,i)
            for j in f:
                F += log(g(f[j]))
                for k in f:
                    F += log(1-g(f[k]-f[j]))
        return F
dataset/ETHPy150Open Mendeley/mrec/mrec/mf/climf.py/CLiMFRecommender.objective/original