Skip to content

Commit 9987da2

Browse files
Auto3Dseg -> Auto3DSeg, use cpu in DataAnalyzer (#970)
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com> Fixes #967 . and change "Auto3Dseg" to "Auto3DSeg" in notebook ### Description A few sentences describing the changes proposed in this pull request. ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Notebook runs automatically `./runner [-p <regex_pattern>]` Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
1 parent 5655849 commit 9987da2

8 files changed

+22
-22
lines changed

auto3dseg/notebooks/auto3dseg_autorunner_ref_api.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# MONAI Auto3Dseg Reference Python APIs\n",
7+
"# MONAI Auto3DSeg Reference Python APIs\n",
88
"\n",
9-
"In this notebook, we will break down the Auto3Dseg by the modules in the pipeline and introduce the API calls in Python and CLI commands. Particularly, if you have used the AutoRunner class, we will map the AutoRunner commands and configurations to each of the Auto3Dseg module APIs\n",
9+
"In this notebook, we will break down the Auto3DSeg by the modules in the pipeline and introduce the API calls in Python and CLI commands. Particularly, if you have used the AutoRunner class, we will map the AutoRunner commands and configurations to each of the Auto3DSeg module APIs\n",
1010
"\n",
1111
"![workflow](../figures/workflow.png)\n",
1212
"\n",
@@ -150,7 +150,7 @@
150150
"runner.run() \n",
151151
"```\n",
152152
"\n",
153-
"The two lines cover the typical settings in Auto3Dseg and now we are going through the internal APIs calls inside these two lines\n",
153+
"The two lines cover the typical settings in Auto3DSeg and now we are going through the internal APIs calls inside these two lines\n",
154154
"\n",
155155
"### 2.1 Data Analysis\n",
156156
"\n",
@@ -186,7 +186,7 @@
186186
],
187187
"source": [
188188
"datastats_file = os.path.join(work_dir, 'data_stats.yaml')\n",
189-
"analyser = DataAnalyzer(datalist_file, dataroot, output_path=datastats_file)\n",
189+
"analyser = DataAnalyzer(datalist_file, dataroot, output_path=datastats_file, device=\"cpu\")\n",
190190
"datastat = analyser.get_all_case_stats()"
191191
]
192192
},
@@ -297,7 +297,7 @@
297297
"source": [
298298
"### 2.2.1 Getting and Saving the history to hard drive\n",
299299
"\n",
300-
"If the users continue to train the algorithms on local system, The history of the algorithm generation can be fetched via `get_history` method of the `BundleGen` object. There also are scenarios that users need to stop the Python process after the `algo_gen`. For example, the users may need to transfer the files to a remote cluster to start the training. `Auto3Dseg` offers a utility function `export_bundle_algo_history` to dump the history to hard drive and recall it by `import_bundle_algo_history`. \n",
300+
"If the users continue to train the algorithms on local system, The history of the algorithm generation can be fetched via `get_history` method of the `BundleGen` object. There also are scenarios that users need to stop the Python process after the `algo_gen`. For example, the users may need to transfer the files to a remote cluster to start the training. `Auto3DSeg` offers a utility function `export_bundle_algo_history` to dump the history to hard drive and recall it by `import_bundle_algo_history`. \n",
301301
"\n",
302302
"If the files are copied to a remote system, please make sure the alrogirthm templates are also copied there. Some functions require the path to instantiate the algorithm class properly."
303303
]
@@ -397,7 +397,7 @@
397397
"source": [
398398
"#### 2.3.3 Train with Hyper-parameter Optimization (HPO)\n",
399399
"\n",
400-
"Another method to handle the neural network training is to perform HPO (e.g. training & searching). This is made possible by NNI or Optuna packages which are installed in the MONAI development environment. `AutoRunner` uses NNI as backend via the `NNIGen`, but Optuna HPO can also be chosen via the `OptunaGen` method in the Auto3Dseg pipeline\n",
400+
"Another method to handle the neural network training is to perform HPO (e.g. training & searching). This is made possible by NNI or Optuna packages which are installed in the MONAI development environment. `AutoRunner` uses NNI as backend via the `NNIGen`, but Optuna HPO can also be chosen via the `OptunaGen` method in the Auto3DSeg pipeline\n",
401401
"\n",
402402
"To start a NNI, the users need to prepare a config file `nni_config.yaml` and run the command in bash:\n",
403403
"\n",
@@ -438,7 +438,7 @@
438438
"source": [
439439
"### 2.4 Ensemble\n",
440440
"\n",
441-
"Finally, after the neural networks are trained, `AutoRunner` will apply the ensemble methods in Auto3Dseg to improve the overall performance. \n",
441+
"Finally, after the neural networks are trained, `AutoRunner` will apply the ensemble methods in Auto3DSeg to improve the overall performance. \n",
442442
"\n",
443443
"Here we used a utility function `import_bundle_algo_history` to load the `Algo` that are trained into the ensemble. With the history loaded, we build an ensemble method and use the method to perform the inference on all testing data. By default, `AutoRunner` uses the `AlgoEnsembleBestN` to find the best N models and ensemble the prediction maps by taking the mean of the feature maps.\n",
444444
"\n",

auto3dseg/notebooks/auto3dseg_hello_world.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# MONAI Auto3Dseg \"Hello World\" Example\n",
7+
"# MONAI Auto3DSeg \"Hello World\" Example\n",
88
"\n",
9-
"In this notebook, we will provide a simple demonstration of how to use Auto3Dseg AutoRunner to process a simulated datasets and generate results within minutes.\n",
9+
"In this notebook, we will provide a simple demonstration of how to use Auto3DSeg AutoRunner to process a simulated datasets and generate results within minutes.\n",
1010
"\n",
1111
"## 1. Set up environment, imports and datasets"
1212
]
@@ -611,7 +611,7 @@
611611
"source": [
612612
"## 3. Conclusion\n",
613613
"\n",
614-
"Here we complete the entire pipeline. As you may notice, we can see the algorithms start to learn the datasets and the prediction of background and foreground voxels. Auto3Dseg and AutoRunner are highly configurable. To get better results, you can increase the training time, apply different ensemble method, or use hyper-parameter optimization through the AutoRunner or Auto3Dseg module APIs.\n",
614+
"Here we complete the entire pipeline. As you may notice, we can see the algorithms start to learn the datasets and the prediction of background and foreground voxels. Auto3DSeg and AutoRunner are highly configurable. To get better results, you can increase the training time, apply different ensemble method, or use hyper-parameter optimization through the AutoRunner or Auto3DSeg module APIs.\n",
615615
"\n",
616616
"As a \"Hello World\" notebook, we will end the experiment with simulated datasets here."
617617
]

auto3dseg/notebooks/auto_runner.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# MONAI Auto3Dseg AutoRunner\n",
7+
"# MONAI Auto3DSeg AutoRunner\n",
88
"\n",
99
"This notebook will introduce `AutoRunner`, the interface to run the Auto3Dseg pipeline with minimal user inputs.\n",
1010
"\n",
@@ -122,7 +122,7 @@
122122
"cell_type": "markdown",
123123
"metadata": {},
124124
"source": [
125-
"## 2. Run the Auto3Dseg pipeline in a few lines of code\n",
125+
"## 2. Run the Auto3DSeg pipeline in a few lines of code\n",
126126
"\n",
127127
"Below is the typical usage of AutoRunner\n",
128128
"```python\n",
@@ -285,7 +285,7 @@
285285
"cell_type": "markdown",
286286
"metadata": {},
287287
"source": [
288-
"## 4 Setting Auto3Dseg internal parameters\n",
288+
"## 4 Setting Auto3DSeg internal parameters\n",
289289
"### 4.1 Change the number of folds for cross-validation"
290290
]
291291
},
@@ -446,9 +446,9 @@
446446
"metadata": {},
447447
"source": [
448448
"## 5 Train model with HPO (NNI Grid-search)\n",
449-
"### 5.1 Apply HPO to search hyper-parameter in Auto3Dseg\n",
449+
"### 5.1 Apply HPO to search hyper-parameter in Auto3DSeg\n",
450450
"\n",
451-
"Note: Auto3Dseg supports hyper parameter optimization (HPO) via NNI and Optuna backends. Notebook of how to use these modules can be found in this directory.\n",
451+
"Note: Auto3DSeg supports hyper parameter optimization (HPO) via NNI and Optuna backends. Notebook of how to use these modules can be found in this directory.\n",
452452
"AutoRunner supports NNI backend with a grid search method via automatically generating a the NNI config and run `nnictl` commands in subprocess.\n",
453453
"Note: to run the HPO, you need to ensure the development environment has `nni` package. Please refer to the [MONAI Installation Guide](https://docs.monai.io/en/stable/installation.html#installing-the-recommended-dependencies) for how to install the recommended dependencies."
454454
]

auto3dseg/notebooks/data_analyzer.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Auto3Dseg Data Analyzer\n",
7+
"# Auto3DSeg Data Analyzer\n",
88
"\n",
9-
"Data Analysis is one of the MONAI Auto3Dseg modules. This module provides a comprehensive analysis report via using DataAnalyzer class. In this notebook, we will provide a tutorial on how to use the DataAnalyzer class on simulated and real-world datasets"
9+
"Data Analysis is one of the MONAI Auto3DSeg modules. This module provides a comprehensive analysis report via using DataAnalyzer class. In this notebook, we will provide a tutorial on how to use the DataAnalyzer class on simulated and real-world datasets"
1010
]
1111
},
1212
{

auto3dseg/notebooks/data_analyzer_byoc.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Customize Data Analysis\n",
7+
"# Customize Data Analysis in Auto3DSeg\n",
88
"\n",
99
"In this notebook, we will provide a brief example of how to to customize your data analysis pipeline by writing new operations on new metadata.\n",
1010
"\n",

auto3dseg/notebooks/ensemble_byoc.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Customize Algorithm Ensemble\n",
7+
"# Customize Algorithm Ensemble in Auto3DSeg\n",
88
"\n",
99
"In this notebook, we will provide a brief example of how to to customize your ensemble pipeline by defining new ensemble class\n",
1010
"\n",
@@ -163,7 +163,7 @@
163163
"cell_type": "markdown",
164164
"metadata": {},
165165
"source": [
166-
"### 2.1 Run Auto3Dseg data analyzer, algo generation and training"
166+
"### 2.1 Run Auto3DSeg data analyzer, algo generation and training"
167167
]
168168
},
169169
{

auto3dseg/notebooks/hpo_nni.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# MONAI Auto3Dseg Hyper-parameter Optimization with NNI\n",
7+
"# MONAI Auto3DSeg Hyper-parameter Optimization with NNI\n",
88
"\n",
99
"This notebook provides an example to perform hype-parameter optimization(HPO) on learning rate with grid search method for spleen segmentation using NNI.\n",
1010
"\n",

auto3dseg/notebooks/hpo_optuna.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# MONAI Auto3Dseg Hyper-parameter Optimization with Optuna\n",
7+
"# MONAI Auto3DSeg Hyper-parameter Optimization with Optuna\n",
88
"\n",
99
"This notebook provides an example to perform hype-parameter optimization(HPO) on learning rate with grid search method for spleen segmentation using Optuna.\n",
1010
"\n",

0 commit comments

Comments
 (0)