Skip to content

Commit c5f14b0

Browse files
authored
Update NNUnet to dynUNet in the tutorial (#26)
* [DLMED] update NNUnet to dynUNet Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]>
1 parent 766bee8 commit c5f14b0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ This tutorial shows how to leverage `EnsembleEvaluator`, `MeanEnsemble` and `Vot
5151
This notebook is a quick demo for devices, run the Ignite trainer engine on CPU, GPU and multiple GPUs.
5252
#### [nifti_read_example](./nifti_read_example.ipynb)
5353
Illustrate reading NIfTI files and iterating over image patches of the volumes loaded from them.
54-
#### [nnunet_tutorial](./nnunet_tutorial.ipynb)
55-
This tutorial shows how to train 3D segmentation tasks on all the 10 decathlon datasets with the reimplementation of NNUnet in MONAI.
54+
#### [dynunet_tutorial](./dynunet_tutorial.ipynb)
55+
This tutorial shows how to train 3D segmentation tasks on all the 10 decathlon datasets with the reimplementation of dynUNet in MONAI.
5656
#### [post_transforms](./post_transforms.ipynb)
5757
This notebook shows the usage of several post transforms based on the model output of spleen segmentation task.
5858
#### [public_datasets](./public_datasets.ipynb)

nnunet_tutorial.ipynb renamed to dynunet_tutorial.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Train NNUNet on Decathlon datasets\n",
8-
"This tutorial shows how to train 3D segmentation tasks on all the 10 decathlon datasets.\n",
7+
"# Train DynUNet on Decathlon datasets\n",
8+
"This tutorial shows how to train 3D segmentation tasks on all the 10 decathlon datasets with `DynUNet`.\n",
99
"\n",
1010
"Refer to papers:\n",
1111
"\n",
@@ -90,7 +90,7 @@
9090
"from monai.handlers import MeanDice, StatsHandler\n",
9191
"from monai.inferers import SimpleInferer\n",
9292
"from monai.losses import DiceLoss\n",
93-
"from monai.networks.nets import NNUnet\n",
93+
"from monai.networks.nets import DynUNet\n",
9494
"from monai.transforms import (\n",
9595
" Compose,\n",
9696
" LoadNiftid,\n",
@@ -118,7 +118,7 @@
118118
"metadata": {},
119119
"source": [
120120
"## Select Decathlon task\n",
121-
"The Decathlon dataset contains 10 tasks, this NNUNet tutorial can support all of them.\n",
121+
"The Decathlon dataset contains 10 tasks, this dynUNet tutorial can support all of them.\n",
122122
"\n",
123123
"Just need to select task ID and other parameters will be automatically selected.\n",
124124
"\n",
@@ -448,7 +448,7 @@
448448
" strides.append(stride)\n",
449449
"strides.insert(0, len(spacings) * [1])\n",
450450
"kernels.append(len(spacings) * [3])\n",
451-
"net = NNUnet(\n",
451+
"net = DynUNet(\n",
452452
" spatial_dims=3,\n",
453453
" in_channels=in_channels,\n",
454454
" out_channels=n_class,\n",
@@ -491,7 +491,7 @@
491491
"]\n",
492492
"\n",
493493
"# Define customized evaluator\n",
494-
"class nnUNetEvaluator(SupervisedEvaluator):\n",
494+
"class DynUNetEvaluator(SupervisedEvaluator):\n",
495495
" def _iteration(self, engine, batchdata):\n",
496496
" inputs, targets = self.prepare_batch(batchdata)\n",
497497
" inputs, targets = inputs.to(engine.state.device), targets.to(engine.state.device)\n",
@@ -513,7 +513,7 @@
513513
" return {\"image\": inputs, \"label\": targets, \"pred\": predictions}\n",
514514
"\n",
515515
"\n",
516-
"evaluator = nnUNetEvaluator(\n",
516+
"evaluator = DynUNetEvaluator(\n",
517517
" device=device,\n",
518518
" val_data_loader=val_loader,\n",
519519
" network=net,\n",
@@ -559,7 +559,7 @@
559559
"]\n",
560560
"\n",
561561
"# define customized trainer\n",
562-
"class nnUNetTrainer(SupervisedTrainer):\n",
562+
"class DynUNetTrainer(SupervisedTrainer):\n",
563563
" def _iteration(self, engine, batchdata):\n",
564564
" inputs, targets = self.prepare_batch(batchdata)\n",
565565
" inputs, targets = inputs.to(engine.state.device), targets.to(engine.state.device)\n",
@@ -585,7 +585,7 @@
585585
" return {\"image\": inputs, \"label\": targets, \"pred\": predictions, \"loss\": loss.item()}\n",
586586
"\n",
587587
"\n",
588-
"trainer = nnUNetTrainer(\n",
588+
"trainer = DynUNetTrainer(\n",
589589
" device=device,\n",
590590
" max_epochs=max_epochs,\n",
591591
" train_data_loader=train_loader,\n",

0 commit comments

Comments
 (0)