big refactoring
This commit is contained in:
1 parent
cfc298a2d2
commit
53e063ca7e
10 files changed
+41
-12
No files matched your search
@@ -134,7 +134,7 @@ class SaveCodeToWandbCallback(pl.Callback):
|
||||
self.wandb_save_dir = wandb_save_dir
|
||||
self.files_to_be_saved = [
|
||||
"training_modules/callbacks.py",
|
||||
"training_modules/data_modules.py",
|
||||
"training_modules/datamodules.py",
|
||||
"training_modules/datasets.py",
|
||||
"training_modules/lightning_wrapper.py",
|
||||
"training_modules/loggers.py",
|
||||
|
||||
File renamed without changes.
@@ -3,7 +3,7 @@ from PIL import Image
|
||||
import os
|
||||
|
||||
|
||||
class TestDataset(Dataset):
|
||||
class TestDatasetForImgs(Dataset):
|
||||
|
||||
def __init__(self, img_dir, transform):
|
||||
self.transform = transform
|
||||
|
||||
@@ -10,10 +10,12 @@ from training_modules.models import *
|
||||
|
||||
class LitModel(pl.LightningModule):
|
||||
|
||||
def __init__(self, hparams):
|
||||
def __init__(self, hparams=None):
|
||||
super().__init__()
|
||||
|
||||
self.save_hyperparameters(hparams)
|
||||
if hparams:
|
||||
self.save_hyperparameters(hparams)
|
||||
|
||||
self.model = SimpleLinearMNIST(config=self.hparams)
|
||||
|
||||
def forward(self, x):
|
||||
|
||||
@@ -13,7 +13,8 @@ class SimpleLinearMNIST(nn.Module):
|
||||
|
||||
# mnist images are (1, 28, 28) (channels, width, height)
|
||||
self.model = nn.Sequential(
|
||||
nn.Linear(28 * 28, config["lin1_size"]),
|
||||
nn.Linear(28*28, config["lin1_size"]),
|
||||
# nn.Linear(3*32*32, config["lin1_size"]), # for CIFAR10
|
||||
nn.BatchNorm1d(config["lin1_size"]),
|
||||
nn.ReLU(),
|
||||
nn.Dropout(p=0.3),
|
||||
|
||||
Reference in new issue
Block a user