MCPcopy Create free account
hub / github.com/MichSchli/AVeriTeC / validation_epoch_end

Method validation_epoch_end

models/NaiveSeqClassModule.py:82–95  ·  view source on GitHub ↗
(self, outs)

Source from the content-addressed store, hash-verified

80 return {'val_loss':loss, "src": x, "pred": preds, "target": y}
81
82 def validation_epoch_end(self, outs):
83 if self.use_question_stance_approach:
84 self.handle_end_of_epoch_scoring(outs, self.val_acc, self.val_f1)
85
86 self.log('val_acc_epoch', self.val_acc)
87
88 f1 = self.val_f1.compute()
89 self.val_f1.reset()
90
91 self.log('val_f1_epoch', torch.mean(f1))
92
93 class_names = ["supported", "refuted", "nei", "conflicting"]
94 for i, c_name in enumerate(class_names):
95 self.log("val_f1_" + c_name, f1[i])
96
97
98 def test_step(self, batch, batch_idx):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected