Skip to content

Commit

Permalink
Modify unet notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
giwankim committed Nov 7, 2020
1 parent 2cac589 commit edee80b
Show file tree
Hide file tree
Showing 4 changed files with 1,150 additions and 2,601 deletions.
42 changes: 15 additions & 27 deletions notebooks/01-baseline-pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.insert(0, \"../src\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%reload_ext autoreload\n",
"%autoreload 2\n",
"%reload_ext nb_black"
]
},
Expand Down Expand Up @@ -141,30 +153,6 @@
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def visualize(x, y=None, test=False):\n",
" cmap = plt.cm.get_cmap(\"RdBu\")\n",
" cmap = cmap.reversed()\n",
" if test:\n",
" fig, axes = plt.subplots(1, 4, figsize=(10, 10))\n",
" for i, ax in enumerate(axes):\n",
" img = x[:, :, i]\n",
" ax.imshow(img, cmap=cmap)\n",
" else:\n",
" fig, axes = plt.subplots(1, 5, figsize=(10, 10))\n",
" for i, ax in enumerate(axes[:-1]):\n",
" img = x[:, :, i]\n",
" ax.imshow(img, cmap=cmap)\n",
" axes[-1].imshow(y[:, :, 0], cmap=cmap)\n",
" # plt.tight_layout()\n",
" plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -400,7 +388,7 @@
"outputs": [],
"source": [
"model = Baseline.load_from_checkpoint(\"baseline_bs256_epoch10.ckpt\")\n",
"datamodule = NowcastingDataModule(batch_size=128)\n",
"datamodule = NowcastingDataModule(batch_size=256)\n",
"datamodule.setup(\"test\")"
]
},
Expand Down Expand Up @@ -490,7 +478,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:torch] *",
"display_name": "Python [conda env:torch]",
"language": "python",
"name": "conda-env-torch-py"
},
Expand All @@ -504,7 +492,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.7.8"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit edee80b

Please sign in to comment.