MCPcopy Create free account
hub / github.com/clinicalml/TabLLM / validation_epoch_end

Method validation_epoch_end

t-few/src/models/EncoderDecoder.py:286–298  ·  view source on GitHub ↗
(self, outputs)

Source from the content-addressed store, hash-verified

284 return metrics
285
286 def validation_epoch_end(self, outputs):
287 metrics = self.validation_test_shared_preparation(outputs, self.config.dev_score_file)
288
289 # Consider best validation performance based on AUC
290 relevant_metrics = ['AUC']
291 eval_model_metric = [metrics.get(m, -1) for m in relevant_metrics]
292 if eval_model_metric > self.best_eval_model_metric:
293 self.best_eval_model_metric = eval_model_metric
294 self.best_eval_global_step = self.global_step
295 print(f"Stored new best metric {relevant_metrics} with values {eval_model_metric} at step {self.global_step}.")
296
297 self.save_model()
298 return metrics
299
300 def test_step(self, batch, batch_idx):
301 batch_output = self.predict(batch)

Callers

nothing calls this directly

Calls 2

save_modelMethod · 0.95

Tested by

no test coverage detected