diff --git a/modules/decollate_batch.ipynb b/modules/decollate_batch.ipynb index 6243e9377d..dfa1cb9acd 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, diff --git a/modules/dice_loss_metric_notes.ipynb b/modules/dice_loss_metric_notes.ipynb index c9c4b2e33e..74e47ba223 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,10 +61,13 @@ "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", "\n", + "print_config()\n", + "\n", "\n", "def print_tensor(name, t):\n", " print(f\"{name}: {t.numpy().tolist()} shape: {tuple(t.shape)}\")" @@ -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..e431708f73 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", @@ -195,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)" ] }, { @@ -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..e1c6dab028 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..fa08b7c39e 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", @@ -368,7 +350,6 @@ } ], "source": [ - "%matplotlib inline\n", "def imshows(ims):\n", " nrow = len(ims)\n", " ncol = len(ims[0])\n", @@ -567,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", @@ -608,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", @@ -787,7 +765,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..8ceb7a46c4 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,16 @@ }, { "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", @@ -88,7 +73,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()" ] }, { @@ -301,7 +286,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..16ce24cf75 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()" ] @@ -182,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](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).\n", + "\n", + "If you use the MedNIST dataset, please acknowledge the source." ] }, { @@ -425,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)" ] @@ -1077,7 +415,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..13b5afb27f 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..5749629706 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..3b75bd4e8c 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()" ] @@ -204,15 +168,14 @@ "## 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", "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." ] }, { @@ -524,7 +487,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -538,7 +501,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..58320394f2 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": {}, @@ -9,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", @@ -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,20 +143,19 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Download dataset\n", + "## Download dataset\n", "\n", "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", "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." ] }, { @@ -229,7 +204,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 2: Initialize MONAI components" + "## Initialize MONAI components" ] }, { @@ -436,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", @@ -479,7 +452,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 3: Start Training" + "## Start Training" ] }, { @@ -622,7 +595,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -636,7 +609,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..dd776621b1 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": {}, @@ -9,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", @@ -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,20 +142,19 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Download dataset\n", + "## Download dataset\n", "\n", "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", "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." ] }, { @@ -238,7 +211,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 2: Initialize MONAI components" + "## Initialize MONAI components" ] }, { @@ -438,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", @@ -482,7 +452,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Step 3: Start Training" + "## Start Training" ] }, { @@ -625,7 +595,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -639,7 +609,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.8.10" } }, "nbformat": 4,