コード例 #1
0
ファイル: rte.py プロジェクト: GALI472/dataset-sts
 def eval(self, model):
     res = []
     for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf), (self.grt, self.testf)]:
         if gr is None:
             res.append(None)
             continue
         ypred = model.predict(gr)['score']
         res.append(ev.eval_rte(ypred, gr['score'], fname))
     return tuple(res)
コード例 #2
0
 def eval(self, model):
     res = []
     for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf),
                       (self.grt, self.testf)]:
         if gr is None:
             res.append(None)
             continue
         ypred = model.predict(gr)['score']
         res.append(ev.eval_rte(ypred, gr['score'], fname))
     return tuple(res)
コード例 #3
0
ファイル: rte.py プロジェクト: brmson/dataset-sts
 def eval(self, model):
     res = []
     for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf), (self.grt, self.testf)]:
         if gr is None:
             res.append(None)
             continue
         ypred = []
         for ogr in self.sample_pairs(gr, batch_size=len(gr), shuffle=False, once=True):
             ypred += list(model.predict(ogr)['score'])
         ypred = np.array(ypred)
         res.append(ev.eval_rte(ypred, gr['score'], fname))
     return tuple(res)
コード例 #4
0
 def eval(self, model):
     res = []
     for gr, fname in [(self.gr, self.trainf), (self.grv, self.valf),
                       (self.grt, self.testf)]:
         if gr is None:
             res.append(None)
             continue
         ypred = []
         for ogr in self.sample_pairs(gr,
                                      batch_size=len(gr),
                                      shuffle=False,
                                      once=True):
             ypred += list(model.predict(ogr)['score'])
         ypred = np.array(ypred)
         res.append(ev.eval_rte(ypred, gr['score'], fname))
     return tuple(res)