Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-gopichand committed Aug 20, 2024
1 parent d3930e7 commit d753d06
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 1,269 deletions.
13 changes: 12 additions & 1 deletion nbs/02_datasets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"from datasets import load_dataset,load_dataset_builder\n",
"\n",
"import torchvision.transforms.functional as TF\n",
"from fastcore.test import test_close"
"from fastcore.test import test_close\n",
"from rapidai.init import clean_mem"
]
},
{
Expand Down Expand Up @@ -1049,6 +1050,16 @@
" return cls(*get_dls(*dd.values(), bs=batch_size, collate_fn=f, **kwargs))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dac3b07f",
"metadata": {},
"outputs": [],
"source": [
"clean_mem()"
]
},
{
"cell_type": "markdown",
"id": "ff61b773",
Expand Down
10 changes: 10 additions & 0 deletions nbs/03_convolutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,16 @@
"We have `ch_out` filters like this, so in the end, the result of our convolutional layer will be a batch of images with `ch_out` channels."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
15 changes: 13 additions & 2 deletions nbs/04_learner.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"metadata": {},
"outputs": [],
"source": [
"bs = 1024\n",
"bs = 256\n",
"tds = dsd.with_transform(transformi)"
]
},
Expand Down Expand Up @@ -758,7 +758,7 @@
" order = MetricsCB.order+1\n",
" def __init__(self, plot=False): self.plot = plot\n",
" def before_fit(self, learn):\n",
" learn.epochs = self.mbar = master_bar(range(learn.epochs))\n",
" learn.epochs = self.mbar = master_bar(learn.epochs)\n",
" self.first = True\n",
" if hasattr(learn, 'metrics'): learn.metrics._log = self._log\n",
" self.losses = []\n",
Expand Down Expand Up @@ -1391,6 +1391,17 @@
"MomentumLearner(get_model(), dls, F.cross_entropy, cbs=cbs).lr_find()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2b182795",
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"id": "7bfb9bd2",
Expand Down
12 changes: 11 additions & 1 deletion nbs/05_activations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"x,y = 'image','label'\n",
"name = \"fashion_mnist\"\n",
"dsd = load_dataset(name)\n",
"bs = 1024\n",
"bs = 256\n",
"\n",
"@inplace\n",
"def transformi(b): b[x] = [TF.to_tensor(o) for o in b[x]]\n",
Expand Down Expand Up @@ -1479,6 +1479,16 @@
"astats.plot_stats()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
12 changes: 11 additions & 1 deletion nbs/06_initializing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@inplace\n",
"def transformi(b): b[xl] = [TF.to_tensor(o) for o in b[xl]]\n",
"\n",
"bs = 1024\n",
"bs = 256\n",
"tds = dsd.with_transform(transformi)\n",
"\n",
"dls = DataLoaders.from_dd(tds, bs, num_workers=4)\n",
Expand Down Expand Up @@ -2606,6 +2606,16 @@
"learn.fit(2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
12 changes: 11 additions & 1 deletion nbs/07_accel_sgd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"name = \"fashion_mnist\"\n",
"dsd = load_dataset(name)\n",
"\n",
"bs = 1024\n",
"bs = 256\n",
"xmean,xstd = 0.28, 0.35\n",
"\n",
"@inplace\n",
Expand Down Expand Up @@ -1603,6 +1603,16 @@
"rec.plot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
12 changes: 11 additions & 1 deletion nbs/08_resnet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"source": [
"xl,yl = 'image','label'\n",
"name = \"fashion_mnist\"\n",
"bs = 1024\n",
"bs = 256\n",
"xmean,xstd = 0.28, 0.35\n",
"\n",
"@inplace\n",
Expand Down Expand Up @@ -723,6 +723,16 @@
"learn.fit(epochs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
12 changes: 11 additions & 1 deletion nbs/09_augment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"source": [
"xl,yl = 'image','label'\n",
"name = \"fashion_mnist\"\n",
"bs = 1024\n",
"bs = 256\n",
"xmean,xstd = 0.28, 0.35\n",
"\n",
"@inplace\n",
Expand Down Expand Up @@ -4236,6 +4236,16 @@
"torch.save(learn.model, 'models/data_aug2.pkl')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from rapidai.init import clean_mem\n",
"clean_mem()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
1,244 changes: 0 additions & 1,244 deletions nbs/10_DDPM_v2.ipynb

This file was deleted.

Binary file added nbs/models/data_aug.pkl
Binary file not shown.
Binary file added nbs/models/data_aug2.pkl
Binary file not shown.
Binary file added nbs/models/randcopy1.pkl
Binary file not shown.
Binary file added nbs/models/randcopy2.pkl
Binary file not shown.
4 changes: 0 additions & 4 deletions nbs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ website:
- 07_accel_sgd.ipynb
- 08_resnet.ipynb
- 09_augment.ipynb
- 10_DDPM_v2.ipynb
- 11_fid.ipynb
- 12_diffusion-attn-cond.ipynb
- consistency.ipynb
2 changes: 1 addition & 1 deletion rapidai/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"
16 changes: 4 additions & 12 deletions settings.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
[DEFAULT]
### Python library
repo = rapidai
lib_name = rapidai
version = 0.0.2
version = 0.0.3
min_python = 3.9
license = apache2

### Nbdev
black_formatting = False
doc_path = _docs
lib_path = rapidai
nbs_path = nbs
recursive = True
tst_flags = notest
put_version_in_init = True

### Docs
branch = main
custom_sidebar = False
doc_host = https://m-gopichand.github.io
doc_baseurl = /rapidai
git_url = https://github.com/m-gopichand/rapidai
title = rapidai

### PyPI
audience = Developers
author = Gopichand Madala
author_email = [email protected]
Expand All @@ -40,9 +33,8 @@ jupyter_hooks = False
clean_ids = True
clear_all = False
cell_number = True

### Optional
requirements = matplotlib datasets fastprogress fastcore
requirements = matplotlib datasets fastprogress fastcore
pip_requirements = torch>=1.7,<=2.4 torcheval diffusers einops timm
conda_requirements = pytorch>=1.7,<1.14
dev_requirements = nbdev
dev_requirements = nbdev

0 comments on commit d753d06

Please sign in to comment.