Dev (#135)
* remove logging best so far metric values from mnist model * update tests * update README.md * comment out wandb tests
This commit is contained in:
1 parent
4bdf4e62c6
commit
d5da445e8d
7 files changed
+64
-111
No files matched your search
@@ -50,13 +50,6 @@ class MNISTLitModel(LightningModule):
|
||||
self.val_accuracy = Accuracy()
|
||||
self.test_accuracy = Accuracy()
|
||||
|
||||
self.metric_hist = {
|
||||
"train/acc": [],
|
||||
"val/acc": [],
|
||||
"train/loss": [],
|
||||
"val/loss": [],
|
||||
}
|
||||
|
||||
def forward(self, x: torch.Tensor):
|
||||
return self.model(x)
|
||||
|
||||
@@ -81,11 +74,8 @@ class MNISTLitModel(LightningModule):
|
||||
return {"loss": loss, "preds": preds, "targets": targets}
|
||||
|
||||
def training_epoch_end(self, outputs: List[Any]):
|
||||
# log best so far train acc and train loss
|
||||
self.metric_hist["train/acc"].append(self.trainer.callback_metrics["train/acc"])
|
||||
self.metric_hist["train/loss"].append(self.trainer.callback_metrics["train/loss"])
|
||||
self.log("train/acc_best", max(self.metric_hist["train/acc"]), prog_bar=False)
|
||||
self.log("train/loss_best", min(self.metric_hist["train/loss"]), prog_bar=False)
|
||||
# `outputs` is a list of dicts returned from `training_step()`
|
||||
pass
|
||||
|
||||
def validation_step(self, batch: Any, batch_idx: int):
|
||||
loss, preds, targets = self.step(batch)
|
||||
@@ -98,11 +88,7 @@ class MNISTLitModel(LightningModule):
|
||||
return {"loss": loss, "preds": preds, "targets": targets}
|
||||
|
||||
def validation_epoch_end(self, outputs: List[Any]):
|
||||
# log best so far val acc and val loss
|
||||
self.metric_hist["val/acc"].append(self.trainer.callback_metrics["val/acc"])
|
||||
self.metric_hist["val/loss"].append(self.trainer.callback_metrics["val/loss"])
|
||||
self.log("val/acc_best", max(self.metric_hist["val/acc"]), prog_bar=False)
|
||||
self.log("val/loss_best", min(self.metric_hist["val/loss"]), prog_bar=False)
|
||||
pass
|
||||
|
||||
def test_step(self, batch: Any, batch_idx: int):
|
||||
loss, preds, targets = self.step(batch)
|
||||
|
||||
Reference in new issue
Block a user