Ejemplo n.º 1
0
Archivo: dann.py Proyecto: tmellan/ddan
 def predict_proba(self, X, batch_size=None):
     if batch_size is None: batch_size = self.batch_size
     yprobs = np.zeros((X.shape[0]), dtype=float)
     
     idx = np.arange(X.shape[0])
     vbatch = val_batch_gen([idx, X], batch_size)
     for i, (thisidx, thisX) in enumerate(vbatch):
         yprobs[thisidx] = self.sess.run(self.y_clf, 
             feed_dict={self.X: thisX, self.train: False, self.l: 1.0}).flatten()
     return yprobs
Ejemplo n.º 2
0
    def domains_predict_proba(self, X, batch_size=None):
        if batch_size is None: batch_size = self.batch_size
        dprobs = np.zeros((X.shape[0]), dtype=float)

        idx = np.arange(X.shape[0])
        vbatch = val_batch_gen([idx, X], batch_size)
        for i, (thisidx, thisX) in enumerate(vbatch):
            dprobs[thisidx] = self.sess.run(self.domain_clf,
                                            feed_dict={
                                                self.X: thisX
                                            }).flatten()
        return dprobs