some silly tweaks

This commit is contained in:
hobogalaxy committed 2020-11-21 04:53:31 +01:00
1 parent cc4e896cd2
commit 94cb2375c1
3 files changed
+11 -12

No files matched your search

+9 -5
View File
@@ -1,19 +1,23 @@
num_of_gpus: -1
hparams:
# these hyperparameters should always be in this file
max_epochs: 3
batch_size: 64
lr: 0.001
accumulate_grad_batches: 1
gradient_clip_val: 0.5
output_size: 10
weight_decay: 0.000001
split_ratio: 0.9
gradient_clip_val: 0.5
accumulate_grad_batches: 1
# these hyperparameters are custom, you can add here anything
train_val_split_ratio: 0.9
output_size: 10
lin1_size: 256
lin2_size: 256
lin3_size: 128
resume:
resume: # this is for resuming training from lightning checkpoint
resume_from_ckpt: False
wandb_run_id: "8uuomodb"
ckpt_path: "checkpoints/epoch=2.ckpt"
+1 -1
View File
@@ -13,7 +13,7 @@ def train(config):
# Init data module
datamodule = MNISTDataModule(
batch_size=config["hparams"]["batch_size"],
split_ratio=config["hparams"]["split_ratio"]
split_ratio=config["hparams"]["train_val_split_ratio"]
)
datamodule.prepare_data()
datamodule.setup()
@@ -33,8 +33,6 @@ class LitModel(pl.LightningModule):
acc = accuracy_score(preds, y)
self.log('train_loss', loss, on_step=False, on_epoch=True, logger=True, prog_bar=True)
self.log('train_acc', acc, on_step=False, on_epoch=True, logger=True, prog_bar=True)
# f1 = f1_score(preds, y, average="micro")
# self.log('train_f1', f1, on_step=False, on_epoch=True, logger=True, prog_bar=True)
return loss
@@ -50,9 +48,8 @@ class LitModel(pl.LightningModule):
acc = accuracy_score(preds, y)
self.log('val_loss', loss, on_step=False, on_epoch=True, logger=True, prog_bar=True)
self.log('val_acc', acc, on_step=False, on_epoch=True, logger=True, prog_bar=True)
# f1 = f1_score(preds, y, average="micro")
# self.log('val_f1', f1, on_step=False, on_epoch=True, logger=True, prog_bar=True)
# we can return here anything and then read it in some callback
return preds, y
# logic for a single testing step
@@ -67,8 +64,6 @@ class LitModel(pl.LightningModule):
acc = accuracy_score(preds, y)
self.log('test_loss', loss, on_step=False, on_epoch=True, logger=True, prog_bar=True)
self.log('test_acc', acc, on_step=False, on_epoch=True, logger=True, prog_bar=True)
# f1 = f1_score(preds, y, average="micro")
# self.log('test_f1', f1, on_step=False, on_epoch=True, logger=True, prog_bar=True)
return loss