def on_epoch_end(self, epoch, logs={}): ypred = self.task.predict(self.model, self.val_gr) acc = ev.binclass_accuracy(self.val_gr['score'], ypred)[0] print( ' val acc %f' % (acc, )) logs['acc'] = acc
def on_epoch_end(self, epoch, logs={}): ypred = self.task.predict(self.model, self.val_gr) if 'qids' not in self.val_gr or self.val_gr['qids'] is None: acc = ev.binclass_accuracy(self.val_gr['score'], ypred)[0] print(' val acc %f' % (acc,)) else: acc = ev.recall_at(self.val_gr['qids'], self.val_gr['score'], ypred, N=1) print(' val abcdacc %f' % (acc,)) logs['acc'] = acc
def on_epoch_end(self, epoch, logs={}): ypred = self.task.predict(self.model, self.val_gr) tmp = [] for yp in ypred: tmp.append(yp[0]) ypred = np.array(tmp) acc, y0acc, y1acc, balacc, f_score = ev.binclass_accuracy( self.val_gr['score'], ypred) print(' val acc %f val f1 %f' % (acc, f_score)) logs['acc'] = acc
def on_epoch_end(self, epoch, logs={}): ypred = self.task.predict(self.model, self.val_gr) if 'qids' not in self.val_gr or self.val_gr['qids'] is None: acc = ev.binclass_accuracy(self.val_gr['score'], ypred)[0] print( ' val acc %f' % (acc, )) else: acc = ev.recall_at(self.val_gr['qids'], self.val_gr['score'], ypred, N=1) print( ' val abcdacc %f' % (acc, )) logs['acc'] = acc
def on_epoch_end(self, epoch, logs={}): ypred = self.model.predict(self.val_gr)['score'][:,0] acc = ev.binclass_accuracy(self.val_gr['score'], ypred)[0] print(' val acc %f' % (acc,)) logs['acc'] = acc