Skip to content

Commit e5f8638

Browse files
committed
ds img
1 parent 6066d6c commit e5f8638

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

nbs/image.datasets.ipynb

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "raw",
5-
"metadata": {},
6-
"source": [
7-
"---\n",
8-
"skip_exec: true\n",
9-
"skip_showdoc: true\n",
10-
"---"
11-
]
12-
},
133
{
144
"attachments": {},
155
"cell_type": "markdown",
@@ -79,6 +69,7 @@
7969
"metadata": {},
8070
"outputs": [],
8171
"source": [
72+
"#| export\n",
8273
"set_seed(42)\n",
8374
"logger = logging.getLogger(__name__)\n",
8475
"plt.set_loglevel('INFO')"

nimrod/image/datasets.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/image.datasets.ipynb.
44

55
# %% auto 0
6-
__all__ = ['ImageDataset', 'MNISTDataset', 'MNISTDataModule']
6+
__all__ = ['logger', 'ImageDataset', 'MNISTDataset', 'MNISTDataModule']
77

8-
# %% ../../nbs/image.datasets.ipynb 4
8+
# %% ../../nbs/image.datasets.ipynb 3
99
import torch
1010
import torch.utils.data as data
1111
from torch.utils.data import ConcatDataset, DataLoader, Dataset, random_split
@@ -30,7 +30,12 @@
3030
import logging
3131

3232

33-
# %% ../../nbs/image.datasets.ipynb 7
33+
# %% ../../nbs/image.datasets.ipynb 4
34+
set_seed(42)
35+
logger = logging.getLogger(__name__)
36+
plt.set_loglevel('INFO')
37+
38+
# %% ../../nbs/image.datasets.ipynb 6
3439
class ImageDataset(Dataset):
3540
" Base class for image datasets providing visualization of (image, label) samples"
3641

@@ -80,7 +85,7 @@ def show_random(
8085
self.show_grid(images)
8186

8287

83-
# %% ../../nbs/image.datasets.ipynb 11
88+
# %% ../../nbs/image.datasets.ipynb 10
8489
class MNISTDataset(ImageDataset):
8590
"MNIST digit dataset"
8691

@@ -132,7 +137,7 @@ def train_dev_split(
132137

133138

134139

135-
# %% ../../nbs/image.datasets.ipynb 18
140+
# %% ../../nbs/image.datasets.ipynb 17
136141
class MNISTDataModule(DataModule, LightningDataModule):
137142
def __init__(self,
138143
data_dir: str | os.PathLike = "~/Data/", # path to source data dir

0 commit comments

Comments
 (0)