From 99b69794f272375b282fec20478c61d5720c472e Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Wed, 11 Jan 2023 19:08:30 +0800 Subject: [PATCH 1/8] [DLMED] update notebook format Signed-off-by: Nic Ma --- modules/decollate_batch.ipynb | 88 +++++++++++------------------------ 1 file changed, 27 insertions(+), 61 deletions(-) diff --git a/modules/decollate_batch.ipynb b/modules/decollate_batch.ipynb index 6243e9377d..92e4a98dc7 100644 --- a/modules/decollate_batch.ipynb +++ b/modules/decollate_batch.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + " http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -49,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, @@ -67,54 +83,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.4.0+544.g5e7345d\n", - "Numpy version: 1.21.0\n", - "Pytorch version: 1.9.0+cu102\n", - "MONAI flags: HAS_EXT = False, USE_COMPILED = False\n", - "MONAI rev id: 5e7345d384ae08011b0e250b93f615d6d5190258\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 1.15.0+nv\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.9.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.1.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", "import logging\n", "import os\n", "import sys\n", @@ -162,19 +136,11 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "/workspace/data/medical\n" - ] - } - ], + "outputs": [], "source": [ "directory = os.environ.get(\"MONAI_DATA_DIRECTORY\")\n", "root_dir = tempfile.mkdtemp() if directory is None else directory\n", @@ -190,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -210,7 +176,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -237,7 +203,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -267,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "tags": [] }, @@ -353,7 +319,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "pycharm": { "is_executing": true @@ -382,7 +348,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.8.10" } }, "nbformat": 4, From 24fe7b2c7e35ce1f70f13938531d8de6ba4b3974 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Wed, 11 Jan 2023 23:51:54 +0800 Subject: [PATCH 2/8] [DLMED] update all notebooks Signed-off-by: Nic Ma --- modules/dice_loss_metric_notes.ipynb | 50 +++++++- modules/image_dataset.ipynb | 77 +++---------- modules/integrate_3rd_party_transforms.ipynb | 109 +++++------------- ...ansforms_and_test_time_augmentations.ipynb | 56 +++------ modules/jupyter_utils.ipynb | 54 ++++----- modules/layer_wise_learning_rate.ipynb | 88 +++++--------- modules/learning_rate.ipynb | 64 +++------- modules/load_medical_images.ipynb | 77 +++---------- modules/mednist_GAN_tutorial.ipynb | 90 +++++---------- modules/mednist_GAN_workflow_array.ipynb | 96 ++++++--------- modules/mednist_GAN_workflow_dict.ipynb | 92 ++++++--------- 11 files changed, 293 insertions(+), 560 deletions(-) diff --git a/modules/dice_loss_metric_notes.ipynb b/modules/dice_loss_metric_notes.ipynb index c9c4b2e33e..fe1ed3132b 100644 --- a/modules/dice_loss_metric_notes.ipynb +++ b/modules/dice_loss_metric_notes.ipynb @@ -1,5 +1,22 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "6459ddb8", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "id": "0c5bf94b-4f1d-4e94-a6e6-94644095e910", @@ -10,6 +27,32 @@ "This notebook summarises some of the details relating to the `DiceLoss` and `DiceMetric` classes and their behaviour." ] }, + { + "cell_type": "markdown", + "id": "952771b9", + "metadata": {}, + "source": [ + "## Setup environment" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7b7eb650", + "metadata": {}, + "outputs": [], + "source": [ + "!python -c \"import monai\" || pip install -q \"monai-weekly\"" + ] + }, + { + "cell_type": "markdown", + "id": "55f81921", + "metadata": {}, + "source": [ + "## Setup imports" + ] + }, { "cell_type": "code", "execution_count": 1, @@ -18,9 +61,12 @@ "outputs": [], "source": [ "import torch\n", + "from monai.config import print_config\n", "from monai.losses import DiceLoss\n", "from monai.metrics import DiceMetric\n", - "from monai.transforms import AsDiscrete, Compose\n", + "from monai.transforms import AsDiscrete, Composes\n", + "\n", + "print_config()\n", "\n", "\n", "def print_tensor(name, t):\n", @@ -412,7 +458,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/image_dataset.ipynb b/modules/image_dataset.ipynb index 356b8eb366..0a7c904a14 100644 --- a/modules/image_dataset.ipynb +++ b/modules/image_dataset.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -44,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2021-01-14T12:34:04.909819Z", @@ -54,63 +70,8 @@ }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 1.1.0+16.gd990ff5e\n", - "Numpy version: 1.23.5\n", - "Pytorch version: 1.13.1\n", - "MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False\n", - "MONAI rev id: d990ff5e6acab8655d507aeac934defd4f7a5fdc\n", - "MONAI __file__: /Users/Documents/MONAI/monai/__init__.py\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.10\n", - "Nibabel version: 5.0.0\n", - "scikit-image version: NOT INSTALLED or UNKNOWN VERSION.\n", - "Pillow version: 9.4.0\n", - "Tensorboard version: 2.11.0\n", - "gdown version: 4.6.0\n", - "TorchVision version: 0.14.1\n", - "tqdm version: 4.64.1\n", - "lmdb version: 1.4.0\n", - "psutil version: 5.9.4\n", - "pandas version: 1.5.2\n", - "einops version: 0.6.0\n", - "transformers version: 4.21.3\n", - "mlflow version: 2.1.1\n", - "pynrrd version: 1.0.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ - "# Copyright 2020 - 2021 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", "import os\n", "import tempfile\n", "import shutil\n", @@ -231,7 +192,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/integrate_3rd_party_transforms.ipynb b/modules/integrate_3rd_party_transforms.ipynb index 9a161e5156..ac74fa7177 100644 --- a/modules/integrate_3rd_party_transforms.ipynb +++ b/modules/integrate_3rd_party_transforms.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -34,25 +50,20 @@ "%matplotlib inline" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup imports" + ] + }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "If you use TorchIO for your research, please cite the following paper:\n", - "Pérez-García et al., TorchIO: a Python library for efficient loading,\n", - "preprocessing, augmentation and patch-based sampling of medical images\n", - "in deep learning. Link: https://arxiv.org/abs/2003.04696\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "from monai.utils import first, set_determinism\n", "from monai.transforms import (\n", @@ -81,73 +92,7 @@ "import tempfile\n", "import shutil\n", "import os\n", - "import glob" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup imports" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0rc1+23.gc6793fd0\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: c6793fd0f316a448778d0047664aaf8c1895fe1c\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "`should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n" - ] - } - ], - "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", + "import glob\n", "\n", "print_config()" ] @@ -487,7 +432,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/inverse_transforms_and_test_time_augmentations.ipynb b/modules/inverse_transforms_and_test_time_augmentations.ipynb index b4709962d2..1082a82933 100644 --- a/modules/inverse_transforms_and_test_time_augmentations.ipynb +++ b/modules/inverse_transforms_and_test_time_augmentations.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -67,43 +83,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 1.0.0rc2+13.g3f6a3537\n", - "Numpy version: 1.23.2\n", - "Pytorch version: 1.13.0a0+08820cb\n", - "MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False\n", - "MONAI rev id: 3f6a3537339cfdb9e1afcbe53133cbd63756e5cb\n", - "MONAI __file__: /nfs/home/rbrown/Documents/Code/MONAI/monai/__init__.py\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.9\n", - "Nibabel version: 4.0.1\n", - "scikit-image version: 0.19.3\n", - "Pillow version: 9.2.0\n", - "Tensorboard version: 2.10.0\n", - "gdown version: 4.5.1\n", - "TorchVision version: 0.14.0a0\n", - "tqdm version: 4.64.0\n", - "lmdb version: 1.3.0\n", - "psutil version: 5.9.1\n", - "pandas version: 1.4.3\n", - "einops version: 0.4.1\n", - "transformers version: 4.21.2\n", - "mlflow version: 1.28.0\n", - "pynrrd version: 0.4.3\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "from glob import glob\n", "import matplotlib.pyplot as plt\n", @@ -787,7 +769,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/jupyter_utils.ipynb b/modules/jupyter_utils.ipynb index f80450a2d3..a52bb0a087 100644 --- a/modules/jupyter_utils.ipynb +++ b/modules/jupyter_utils.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -38,47 +54,17 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0+1.g8365443a\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: 8365443ababac313340467e5987c7babe2b5b86a\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 8.2.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", "import torch\n", "\n", "import monai\n", + "from monai.config import print_config\n", "from monai.data import Dataset, DataLoader, create_test_image_2d\n", "from monai.losses import DiceLoss\n", "from monai.networks.nets import UNet\n", @@ -301,7 +287,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/layer_wise_learning_rate.ipynb b/modules/layer_wise_learning_rate.ipynb index 651c83021c..9a7a22b575 100644 --- a/modules/layer_wise_learning_rate.ipynb +++ b/modules/layer_wise_learning_rate.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -41,9 +57,16 @@ "%matplotlib inline" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup imports" + ] + }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "tags": [] }, @@ -72,66 +95,7 @@ "import sys\n", "import shutil\n", "import os\n", - "import logging" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup imports" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0rc1+23.gc6793fd0\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: c6793fd0f316a448778d0047664aaf8c1895fe1c\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], - "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", + "import logging\n", "\n", "print_config()" ] @@ -1077,7 +1041,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/learning_rate.ipynb b/modules/learning_rate.ipynb index 6c229678d4..51bfa44921 100644 --- a/modules/learning_rate.ipynb +++ b/modules/learning_rate.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -41,54 +57,12 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0+1.g8365443a\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: 8365443ababac313340467e5987c7babe2b5b86a\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 8.2.0\n", - "Tensorboard version: 2.2.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", "import os\n", "import shutil\n", "import tempfile\n", @@ -1576,7 +1550,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/load_medical_images.ipynb b/modules/load_medical_images.ipynb index c697db36bf..fd1f44d148 100644 --- a/modules/load_medical_images.ipynb +++ b/modules/load_medical_images.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -45,7 +61,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2021-01-14T12:34:04.909819Z", @@ -55,63 +71,8 @@ }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.8.0+143.g42603b37\n", - "Numpy version: 1.22.0\n", - "Pytorch version: 1.11.0a0+bfe5ad2\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: 42603b378af6ef13328e59dcafcfc10560c04f08\n", - "MONAI __file__: /opt/monai/monai/__init__.py\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.8\n", - "Nibabel version: 3.2.2\n", - "scikit-image version: 0.19.1\n", - "Pillow version: 9.0.1\n", - "Tensorboard version: 2.8.0\n", - "gdown version: 4.2.1\n", - "TorchVision version: 0.12.0a0\n", - "tqdm version: 4.62.3\n", - "lmdb version: 1.3.0\n", - "psutil version: 5.9.0\n", - "pandas version: 1.3.5\n", - "einops version: 0.4.0\n", - "transformers version: 4.16.2\n", - "mlflow version: 1.23.1\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], + "outputs": [], "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", "import os\n", "import shutil\n", "import SimpleITK as sitk # noqa: N813\n", @@ -715,7 +676,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/mednist_GAN_tutorial.ipynb b/modules/mednist_GAN_tutorial.ipynb index 9ddf7b4c7b..e16fe2cb4f 100644 --- a/modules/mednist_GAN_tutorial.ipynb +++ b/modules/mednist_GAN_tutorial.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -35,9 +51,16 @@ "%matplotlib inline" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup imports" + ] + }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "tags": [] }, @@ -63,66 +86,7 @@ "import torch\n", "import matplotlib.pyplot as plt\n", "import os\n", - "import tempfile" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setup imports" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0rc1+23.gc6793fd0\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: c6793fd0f316a448778d0047664aaf8c1895fe1c\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], - "source": [ - "# Copyright 2020 MONAI Consortium\n", - "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", - "# you may not use this file except in compliance with the License.\n", - "# You may obtain a copy of the License at\n", - "# http://www.apache.org/licenses/LICENSE-2.0\n", - "# Unless required by applicable law or agreed to in writing, software\n", - "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", - "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", - "# See the License for the specific language governing permissions and\n", - "# limitations under the License.\n", - "\n", + "import tempfile\n", "\n", "print_config()" ] @@ -524,7 +488,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -538,7 +502,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/mednist_GAN_workflow_array.ipynb b/modules/mednist_GAN_workflow_array.ipynb index 4e4361d8f7..4a2aef1b37 100644 --- a/modules/mednist_GAN_workflow_array.ipynb +++ b/modules/mednist_GAN_workflow_array.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -30,9 +46,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 1: Setup\n", - "\n", - "### Setup environment" + "## Setup environment" ] }, { @@ -48,9 +62,18 @@ ] }, { - "cell_type": "code", - "execution_count": 1, + "cell_type": "markdown", "metadata": {}, + "source": [ + "## Setup imports" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "from monai.utils import set_determinism\n", @@ -79,55 +102,8 @@ "import sys\n", "import logging\n", "import tempfile\n", - "import os" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Setup imports" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0rc1+23.gc6793fd0\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: c6793fd0f316a448778d0047664aaf8c1895fe1c\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], - "source": [ + "import os\n", + "\n", "print_config()" ] }, @@ -135,7 +111,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Setup data directory\n", + "## Setup data directory\n", "\n", "You can specify a directory with the `MONAI_DATA_DIRECTORY` environment variable. \n", "This allows you to save results and reuse downloads. \n", @@ -167,7 +143,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Download dataset\n", + "## Download dataset\n", "\n", "Downloads and extracts the dataset.\n", "\n", @@ -229,7 +205,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 2: Initialize MONAI components" + "## Initialize MONAI components" ] }, { @@ -479,7 +455,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 3: Start Training" + "## Start Training" ] }, { @@ -622,7 +598,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -636,7 +612,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/modules/mednist_GAN_workflow_dict.ipynb b/modules/mednist_GAN_workflow_dict.ipynb index 7c81c438f6..d65538ac9d 100644 --- a/modules/mednist_GAN_workflow_dict.ipynb +++ b/modules/mednist_GAN_workflow_dict.ipynb @@ -1,5 +1,21 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Copyright (c) MONAI Consortium \n", + "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", + "you may not use this file except in compliance with the License. \n", + "You may obtain a copy of the License at \n", + "http://www.apache.org/licenses/LICENSE-2.0 \n", + "Unless required by applicable law or agreed to in writing, software \n", + "distributed under the License is distributed on an \"AS IS\" BASIS, \n", + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", + "See the License for the specific language governing permissions and \n", + "limitations under the License." + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -30,9 +46,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 1: Setup\n", - "\n", - "### Setup environment" + "## Setup environment" ] }, { @@ -46,9 +60,16 @@ "%matplotlib inline" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Setup imports" + ] + }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [] }, @@ -80,55 +101,8 @@ "import sys\n", "import shutil\n", "import os\n", - "import logging" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Setup imports" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "MONAI version: 0.6.0rc1+23.gc6793fd0\n", - "Numpy version: 1.20.3\n", - "Pytorch version: 1.9.0a0+c3d40fd\n", - "MONAI flags: HAS_EXT = True, USE_COMPILED = False\n", - "MONAI rev id: c6793fd0f316a448778d0047664aaf8c1895fe1c\n", - "\n", - "Optional dependencies:\n", - "Pytorch Ignite version: 0.4.5\n", - "Nibabel version: 3.2.1\n", - "scikit-image version: 0.15.0\n", - "Pillow version: 7.0.0\n", - "Tensorboard version: 2.5.0\n", - "gdown version: 3.13.0\n", - "TorchVision version: 0.10.0a0\n", - "ITK version: 5.1.2\n", - "tqdm version: 4.53.0\n", - "lmdb version: 1.2.1\n", - "psutil version: 5.8.0\n", - "pandas version: 1.1.4\n", - "einops version: 0.3.0\n", - "\n", - "For details about installing the optional dependencies, please visit:\n", - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", - "\n" - ] - } - ], - "source": [ + "import logging\n", + "\n", "print_config()" ] }, @@ -136,7 +110,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Setup data directory\n", + "## Setup data directory\n", "\n", "You can specify a directory with the `MONAI_DATA_DIRECTORY` environment variable. \n", "This allows you to save results and reuse downloads. \n", @@ -168,7 +142,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Download dataset\n", + "## Download dataset\n", "\n", "Downloads and extracts the dataset.\n", "\n", @@ -238,7 +212,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 2: Initialize MONAI components" + "## Initialize MONAI components" ] }, { @@ -482,7 +456,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 3: Start Training" + "## Start Training" ] }, { @@ -625,7 +599,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -639,7 +613,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.8.10" } }, "nbformat": 4, From b4809a509a4905cde8749163f3b1a4b340fa12be Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Thu, 12 Jan 2023 00:02:30 +0800 Subject: [PATCH 3/8] [DLMED] fix typo Signed-off-by: Nic Ma --- modules/dice_loss_metric_notes.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/dice_loss_metric_notes.ipynb b/modules/dice_loss_metric_notes.ipynb index fe1ed3132b..214a405bc8 100644 --- a/modules/dice_loss_metric_notes.ipynb +++ b/modules/dice_loss_metric_notes.ipynb @@ -64,7 +64,7 @@ "from monai.config import print_config\n", "from monai.losses import DiceLoss\n", "from monai.metrics import DiceMetric\n", - "from monai.transforms import AsDiscrete, Composes\n", + "from monai.transforms import AsDiscrete, Compose\n", "\n", "print_config()\n", "\n", From 6e1488e319093ab5335653abe6220d7567a107b7 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Thu, 12 Jan 2023 22:20:40 +0800 Subject: [PATCH 4/8] [DLMED] update copyright Signed-off-by: Nic Ma --- modules/decollate_batch.ipynb | 2 +- modules/dice_loss_metric_notes.ipynb | 2 +- modules/image_dataset.ipynb | 2 +- modules/integrate_3rd_party_transforms.ipynb | 2 +- modules/inverse_transforms_and_test_time_augmentations.ipynb | 2 +- modules/jupyter_utils.ipynb | 2 +- modules/layer_wise_learning_rate.ipynb | 2 +- modules/learning_rate.ipynb | 2 +- modules/load_medical_images.ipynb | 2 +- modules/mednist_GAN_tutorial.ipynb | 2 +- modules/mednist_GAN_workflow_array.ipynb | 2 +- modules/mednist_GAN_workflow_dict.ipynb | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/decollate_batch.ipynb b/modules/decollate_batch.ipynb index 92e4a98dc7..dfa1cb9acd 100644 --- a/modules/decollate_batch.ipynb +++ b/modules/decollate_batch.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - " http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/dice_loss_metric_notes.ipynb b/modules/dice_loss_metric_notes.ipynb index 214a405bc8..74e47ba223 100644 --- a/modules/dice_loss_metric_notes.ipynb +++ b/modules/dice_loss_metric_notes.ipynb @@ -9,7 +9,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/image_dataset.ipynb b/modules/image_dataset.ipynb index 0a7c904a14..65faf54544 100644 --- a/modules/image_dataset.ipynb +++ b/modules/image_dataset.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/integrate_3rd_party_transforms.ipynb b/modules/integrate_3rd_party_transforms.ipynb index ac74fa7177..e1c6dab028 100644 --- a/modules/integrate_3rd_party_transforms.ipynb +++ b/modules/integrate_3rd_party_transforms.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/inverse_transforms_and_test_time_augmentations.ipynb b/modules/inverse_transforms_and_test_time_augmentations.ipynb index 1082a82933..3c9a7c4f2d 100644 --- a/modules/inverse_transforms_and_test_time_augmentations.ipynb +++ b/modules/inverse_transforms_and_test_time_augmentations.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/jupyter_utils.ipynb b/modules/jupyter_utils.ipynb index a52bb0a087..7ee78405c1 100644 --- a/modules/jupyter_utils.ipynb +++ b/modules/jupyter_utils.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/layer_wise_learning_rate.ipynb b/modules/layer_wise_learning_rate.ipynb index 9a7a22b575..2e5cb0e906 100644 --- a/modules/layer_wise_learning_rate.ipynb +++ b/modules/layer_wise_learning_rate.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/learning_rate.ipynb b/modules/learning_rate.ipynb index 51bfa44921..13b5afb27f 100644 --- a/modules/learning_rate.ipynb +++ b/modules/learning_rate.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/load_medical_images.ipynb b/modules/load_medical_images.ipynb index fd1f44d148..5749629706 100644 --- a/modules/load_medical_images.ipynb +++ b/modules/load_medical_images.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/mednist_GAN_tutorial.ipynb b/modules/mednist_GAN_tutorial.ipynb index e16fe2cb4f..b2b1855d53 100644 --- a/modules/mednist_GAN_tutorial.ipynb +++ b/modules/mednist_GAN_tutorial.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/mednist_GAN_workflow_array.ipynb b/modules/mednist_GAN_workflow_array.ipynb index 4a2aef1b37..68fe7df169 100644 --- a/modules/mednist_GAN_workflow_array.ipynb +++ b/modules/mednist_GAN_workflow_array.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", diff --git a/modules/mednist_GAN_workflow_dict.ipynb b/modules/mednist_GAN_workflow_dict.ipynb index d65538ac9d..676ef5ba0a 100644 --- a/modules/mednist_GAN_workflow_dict.ipynb +++ b/modules/mednist_GAN_workflow_dict.ipynb @@ -8,7 +8,7 @@ "Licensed under the Apache License, Version 2.0 (the \"License\"); \n", "you may not use this file except in compliance with the License. \n", "You may obtain a copy of the License at \n", - "http://www.apache.org/licenses/LICENSE-2.0 \n", + "    http://www.apache.org/licenses/LICENSE-2.0 \n", "Unless required by applicable law or agreed to in writing, software \n", "distributed under the License is distributed on an \"AS IS\" BASIS, \n", "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n", From 786e0cc25faf8f92312a52f09c4f0dee7f80cf56 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Thu, 12 Jan 2023 22:36:25 +0800 Subject: [PATCH 5/8] [DLMED] update RSNA Bone Age Challenge link Signed-off-by: Nic Ma --- modules/image_dataset.ipynb | 2 +- modules/layer_wise_learning_rate.ipynb | 2 +- modules/mednist_GAN_tutorial.ipynb | 2 +- modules/mednist_GAN_workflow_array.ipynb | 2 +- modules/mednist_GAN_workflow_dict.ipynb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/image_dataset.ipynb b/modules/image_dataset.ipynb index 65faf54544..e431708f73 100644 --- a/modules/image_dataset.ipynb +++ b/modules/image_dataset.ipynb @@ -156,7 +156,7 @@ " transform_with_metadata=True,\n", ")\n", "print(\"image shape:\", img_dataset[0][0].shape)\n", - "print(\"seg. shape:\", img_dataset[0][1].shape)" + "print(\"seg shape:\", img_dataset[0][1].shape)" ] }, { diff --git a/modules/layer_wise_learning_rate.ipynb b/modules/layer_wise_learning_rate.ipynb index 2e5cb0e906..a59d197ac7 100644 --- a/modules/layer_wise_learning_rate.ipynb +++ b/modules/layer_wise_learning_rate.ipynb @@ -146,7 +146,7 @@ "source": [ "## Create training experiment with MedNISTDataset and workflow\n", "\n", - "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions), [the RSNA Bone Age Challenge](http://rsnachallenges.cloudapp.net/competitions/4), and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest)." + "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions), [the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017), and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest)." ] }, { diff --git a/modules/mednist_GAN_tutorial.ipynb b/modules/mednist_GAN_tutorial.ipynb index b2b1855d53..d8dff3b3ef 100644 --- a/modules/mednist_GAN_tutorial.ipynb +++ b/modules/mednist_GAN_tutorial.ipynb @@ -168,7 +168,7 @@ "## Download dataset\n", "\n", "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions),\n", - "[the RSNA Bone Age Challenge](http://rsnachallenges.cloudapp.net/competitions/4),\n", + "[the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017),\n", "and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest).\n", "\n", "The dataset is kindly made available by [Dr. Bradley J. Erickson M.D., Ph.D.](https://www.mayo.edu/research/labs/radiology-informatics/overview) (Department of Radiology, Mayo Clinic)\n", diff --git a/modules/mednist_GAN_workflow_array.ipynb b/modules/mednist_GAN_workflow_array.ipynb index 68fe7df169..9aac9366cf 100644 --- a/modules/mednist_GAN_workflow_array.ipynb +++ b/modules/mednist_GAN_workflow_array.ipynb @@ -148,7 +148,7 @@ "Downloads and extracts the dataset.\n", "\n", "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions),\n", - "[the RSNA Bone Age Challenge](http://rsnachallenges.cloudapp.net/competitions/4),\n", + "[the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017),\n", "and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest).\n", "\n", "The dataset is kindly made available by [Dr. Bradley J. Erickson M.D., Ph.D.](https://www.mayo.edu/research/labs/radiology-informatics/overview) (Department of Radiology, Mayo Clinic)\n", diff --git a/modules/mednist_GAN_workflow_dict.ipynb b/modules/mednist_GAN_workflow_dict.ipynb index 676ef5ba0a..0953e93dfd 100644 --- a/modules/mednist_GAN_workflow_dict.ipynb +++ b/modules/mednist_GAN_workflow_dict.ipynb @@ -147,7 +147,7 @@ "Downloads and extracts the dataset.\n", "\n", "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions),\n", - "[the RSNA Bone Age Challenge](http://rsnachallenges.cloudapp.net/competitions/4),\n", + "[the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017),\n", "and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest).\n", "\n", "The dataset is kindly made available by [Dr. Bradley J. Erickson M.D., Ph.D.](https://www.mayo.edu/research/labs/radiology-informatics/overview) (Department of Radiology, Mayo Clinic)\n", From d0ce13c94cce7a176340414cf7c9697a5a156ded Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Thu, 12 Jan 2023 23:12:33 +0800 Subject: [PATCH 6/8] [DLMED] update according to comments Signed-off-by: Nic Ma --- ...ansforms_and_test_time_augmentations.ipynb | 4 - modules/layer_wise_learning_rate.ipynb | 636 +----------------- modules/mednist_GAN_tutorial.ipynb | 3 +- modules/mednist_GAN_workflow_array.ipynb | 7 +- modules/mednist_GAN_workflow_dict.ipynb | 8 +- 5 files changed, 10 insertions(+), 648 deletions(-) diff --git a/modules/inverse_transforms_and_test_time_augmentations.ipynb b/modules/inverse_transforms_and_test_time_augmentations.ipynb index 3c9a7c4f2d..fa08b7c39e 100644 --- a/modules/inverse_transforms_and_test_time_augmentations.ipynb +++ b/modules/inverse_transforms_and_test_time_augmentations.ipynb @@ -350,7 +350,6 @@ } ], "source": [ - "%matplotlib inline\n", "def imshows(ims):\n", " nrow = len(ims)\n", " ncol = len(ims[0])\n", @@ -549,7 +548,6 @@ } ], "source": [ - "%matplotlib inline\n", "to_imshow = []\n", "for file in np.random.choice(val_files, size=5, replace=False):\n", " data = val_transforms(file)\n", @@ -590,8 +588,6 @@ } ], "source": [ - "%matplotlib inline\n", - "\n", "# Need minimal transforms just to be able to show the unmodified originals\n", "minimal_transforms = Compose([\n", " LoadImaged(keys, image_only=True),\n", diff --git a/modules/layer_wise_learning_rate.ipynb b/modules/layer_wise_learning_rate.ipynb index a59d197ac7..a9f707c1cf 100644 --- a/modules/layer_wise_learning_rate.ipynb +++ b/modules/layer_wise_learning_rate.ipynb @@ -146,7 +146,9 @@ "source": [ "## Create training experiment with MedNISTDataset and workflow\n", "\n", - "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions), [the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017), and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest)." + "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions), [the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017), and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest).\n", + "\n", + "If you use the MedNIST dataset, please acknowledge the source, e.g." ] }, { @@ -389,637 +391,9 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "DenseNet121(\n", - " (features): Sequential(\n", - " (conv0): Conv2d(1, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)\n", - " (norm0): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu0): ReLU(inplace=True)\n", - " (pool0): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)\n", - " (denseblock1): _DenseBlock(\n", - " (denselayer1): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer2): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(96, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(96, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer3): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer4): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(160, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(160, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer5): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(192, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer6): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(224, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(224, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " )\n", - " (transition1): _Transition(\n", - " (norm): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu): ReLU(inplace=True)\n", - " (conv): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (pool): AvgPool2d(kernel_size=2, stride=2, padding=0)\n", - " )\n", - " (denseblock2): _DenseBlock(\n", - " (denselayer1): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(128, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer2): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(160, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(160, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer3): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(192, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(192, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer4): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(224, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(224, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer5): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer6): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(288, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(288, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer7): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(320, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(320, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer8): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(352, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(352, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer9): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(384, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer10): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(416, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(416, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer11): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(448, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(448, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer12): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(480, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " )\n", - " (transition2): _Transition(\n", - " (norm): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu): ReLU(inplace=True)\n", - " (conv): Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (pool): AvgPool2d(kernel_size=2, stride=2, padding=0)\n", - " )\n", - " (denseblock3): _DenseBlock(\n", - " (denselayer1): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(256, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer2): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(288, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(288, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer3): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(320, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(320, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer4): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(352, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(352, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer5): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(384, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(384, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer6): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(416, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(416, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer7): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(448, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(448, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer8): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(480, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(480, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer9): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer10): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(544, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(544, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer11): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(576, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(576, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer12): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(608, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(608, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer13): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(640, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(640, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer14): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(672, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer15): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(704, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(704, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer16): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(736, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(736, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer17): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer18): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(800, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(800, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer19): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(832, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(832, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer20): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(864, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(864, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer21): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(896, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(896, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer22): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(928, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(928, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer23): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(960, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(960, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer24): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(992, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(992, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " )\n", - " (transition3): _Transition(\n", - " (norm): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu): ReLU(inplace=True)\n", - " (conv): Conv2d(1024, 512, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (pool): AvgPool2d(kernel_size=2, stride=2, padding=0)\n", - " )\n", - " (denseblock4): _DenseBlock(\n", - " (denselayer1): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(512, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer2): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(544, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(544, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer3): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(576, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(576, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer4): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(608, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(608, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer5): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(640, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(640, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer6): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(672, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(672, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer7): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(704, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(704, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer8): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(736, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(736, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer9): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(768, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(768, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer10): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(800, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(800, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer11): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(832, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(832, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer12): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(864, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(864, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer13): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(896, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(896, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer14): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(928, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(928, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer15): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(960, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(960, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " (denselayer16): _DenseLayer(\n", - " (layers): Sequential(\n", - " (norm1): BatchNorm2d(992, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu1): ReLU(inplace=True)\n", - " (conv1): Conv2d(992, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)\n", - " (norm2): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " (relu2): ReLU(inplace=True)\n", - " (conv2): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)\n", - " )\n", - " )\n", - " )\n", - " (norm5): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)\n", - " )\n", - " (class_layers): Sequential(\n", - " (relu): ReLU(inplace=True)\n", - " (pool): AdaptiveAvgPool2d(output_size=1)\n", - " (flatten): Flatten(start_dim=1, end_dim=-1)\n", - " (out): Linear(in_features=1024, out_features=6, bias=True)\n", - " )\n", - ")\n" - ] - } - ], + "outputs": [], "source": [ "print(net)" ] diff --git a/modules/mednist_GAN_tutorial.ipynb b/modules/mednist_GAN_tutorial.ipynb index d8dff3b3ef..5a64571bfa 100644 --- a/modules/mednist_GAN_tutorial.ipynb +++ b/modules/mednist_GAN_tutorial.ipynb @@ -175,8 +175,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g. \n", - "https://github.com/Project-MONAI/tutorials/blob/main/2d_classification/mednist_tutorial.ipynb." + "If you use the MedNIST dataset, please acknowledge the source, e.g." ] }, { diff --git a/modules/mednist_GAN_workflow_array.ipynb b/modules/mednist_GAN_workflow_array.ipynb index 9aac9366cf..f8ef481185 100644 --- a/modules/mednist_GAN_workflow_array.ipynb +++ b/modules/mednist_GAN_workflow_array.ipynb @@ -25,7 +25,7 @@ "The MONAI framework can be used to easily design, train, and evaluate generative adversarial networks.\n", "This notebook exemplifies using MONAI components to design and train a simple GAN model to reconstruct images of Hand CT scans.\n", "\n", - "Read the [MONAI Mednist GAN Tutorial](https://github.com/Project-MONAI/tutorials/blob/main/modules/mednist_GAN_tutorial.ipynb) for details about the network architecture and loss functions.\n", + "Read the [MONAI Mednist GAN Tutorial](./mednist_GAN_tutorial.ipynb) for details about the network architecture and loss functions.\n", "\n", "**Table of Contents**\n", "\n", @@ -155,8 +155,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g. \n", - "https://github.com/Project-MONAI/tutorials/blob/main/2d_classification/mednist_tutorial.ipynb." + "If you use the MedNIST dataset, please acknowledge the source, e.g." ] }, { @@ -412,8 +411,6 @@ "\n", "MONAI Workflow engine for adversarial learning. The components come together here with the GanTrainer.\n", "\n", - "Uses a training loop based on Goodfellow et al. 2014 https://arxiv.org/abs/1406.266.\n", - "\n", "```\n", "Training Loop: for each batch of data size m\n", " 1. Generate m fakes from random latent codes.\n", diff --git a/modules/mednist_GAN_workflow_dict.ipynb b/modules/mednist_GAN_workflow_dict.ipynb index 0953e93dfd..4d7784ba7c 100644 --- a/modules/mednist_GAN_workflow_dict.ipynb +++ b/modules/mednist_GAN_workflow_dict.ipynb @@ -25,7 +25,7 @@ "The MONAI framework can be used to easily design, train, and evaluate generative adversarial networks.\n", "This notebook exemplifies using MONAI components to design and train a simple GAN model to reconstruct images of Hand CT scans.\n", "\n", - "Read the [MONAI Mednist GAN Tutorial](https://github.com/Project-MONAI/tutorials/blob/main/modules/mednist_GAN_tutorial.ipynb) for details about the network architecture and loss functions.\n", + "Read the [MONAI Mednist GAN Tutorial](./mednist_GAN_tutorial.ipynb) for details about the network architecture and loss functions.\n", "\n", "**Table of Contents**\n", "\n", @@ -154,8 +154,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g. \n", - "https://github.com/Project-MONAI/tutorials/blob/main/2d_classification/mednist_tutorial.ipynb." + "If you use the MedNIST dataset, please acknowledge the source, e.g." ] }, { @@ -412,9 +411,6 @@ "### Create GanTrainer\n", "\n", "MONAI Workflow engine for adversarial learning. The components come together here with the GanTrainer.\n", - "\n", - "Uses a training loop based on Goodfellow et al. 2014 https://arxiv.org/abs/1406.266.\n", - "\n", "```\n", "Training Loop: for each batch of data size m\n", " 1. Generate m fakes from random latent codes.\n", From aa5f5f8684a809c77b62131b5a420cfb81f44aed Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Fri, 13 Jan 2023 22:04:10 +0800 Subject: [PATCH 7/8] [DLMED] fix typo in the notebooks Signed-off-by: Nic Ma --- modules/jupyter_utils.ipynb | 2 +- modules/layer_wise_learning_rate.ipynb | 2 +- modules/mednist_GAN_tutorial.ipynb | 2 +- modules/mednist_GAN_workflow_array.ipynb | 2 +- modules/mednist_GAN_workflow_dict.ipynb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/jupyter_utils.ipynb b/modules/jupyter_utils.ipynb index 7ee78405c1..41b4430e9c 100644 --- a/modules/jupyter_utils.ipynb +++ b/modules/jupyter_utils.ipynb @@ -74,7 +74,7 @@ "from monai.utils.enums import CommonKeys\n", "from monai.handlers import MeanDice, ValidationHandler, MetricLogger, from_engine\n", "\n", - "monai.config.print_config()" + "print_config()" ] }, { diff --git a/modules/layer_wise_learning_rate.ipynb b/modules/layer_wise_learning_rate.ipynb index a9f707c1cf..16ce24cf75 100644 --- a/modules/layer_wise_learning_rate.ipynb +++ b/modules/layer_wise_learning_rate.ipynb @@ -148,7 +148,7 @@ "\n", "The MedNIST dataset was gathered from several sets from [TCIA](https://wiki.cancerimagingarchive.net/display/Public/Data+Usage+Policies+and+Restrictions), [the RSNA Bone Age Challenge](https://www.rsna.org/education/ai-resources-and-training/ai-image-challenge/rsna-pediatric-bone-age-challenge-2017), and [the NIH Chest X-ray dataset](https://cloud.google.com/healthcare/docs/resources/public-datasets/nih-chest).\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g." + "If you use the MedNIST dataset, please acknowledge the source." ] }, { diff --git a/modules/mednist_GAN_tutorial.ipynb b/modules/mednist_GAN_tutorial.ipynb index 5a64571bfa..3b75bd4e8c 100644 --- a/modules/mednist_GAN_tutorial.ipynb +++ b/modules/mednist_GAN_tutorial.ipynb @@ -175,7 +175,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g." + "If you use the MedNIST dataset, please acknowledge the source." ] }, { diff --git a/modules/mednist_GAN_workflow_array.ipynb b/modules/mednist_GAN_workflow_array.ipynb index f8ef481185..58320394f2 100644 --- a/modules/mednist_GAN_workflow_array.ipynb +++ b/modules/mednist_GAN_workflow_array.ipynb @@ -155,7 +155,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g." + "If you use the MedNIST dataset, please acknowledge the source." ] }, { diff --git a/modules/mednist_GAN_workflow_dict.ipynb b/modules/mednist_GAN_workflow_dict.ipynb index 4d7784ba7c..dd776621b1 100644 --- a/modules/mednist_GAN_workflow_dict.ipynb +++ b/modules/mednist_GAN_workflow_dict.ipynb @@ -154,7 +154,7 @@ "under the Creative Commons [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/).\n", "\n", "\n", - "If you use the MedNIST dataset, please acknowledge the source, e.g." + "If you use the MedNIST dataset, please acknowledge the source." ] }, { From 1fd610c17919741d7c0d687b2daa834cadb271eb Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Mon, 16 Jan 2023 18:00:41 +0800 Subject: [PATCH 8/8] [DLMED] remove imports Signed-off-by: Nic Ma --- modules/jupyter_utils.ipynb | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/jupyter_utils.ipynb b/modules/jupyter_utils.ipynb index 41b4430e9c..8ceb7a46c4 100644 --- a/modules/jupyter_utils.ipynb +++ b/modules/jupyter_utils.ipynb @@ -63,7 +63,6 @@ "import numpy as np\n", "import torch\n", "\n", - "import monai\n", "from monai.config import print_config\n", "from monai.data import Dataset, DataLoader, create_test_image_2d\n", "from monai.losses import DiceLoss\n",