forked from Project-MONAI/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flake8 error (Project-MONAI#1618)
Fixes Project-MONAI#1617 ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [ ] Avoid including large-size files in the PR. - [ ] Clean up long text outputs from code cells in the notebook. - [ ] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [ ] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` --------- Signed-off-by: YunLiu <[email protected]>
- Loading branch information
Showing
19 changed files
with
126 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,7 +265,9 @@ | |
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "d11681af-3210-4b2b-b7bd-8ad8dedfe230", | ||
"metadata": {}, | ||
"metadata": { | ||
"lines_to_next_cell": 2 | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
|
@@ -310,8 +312,7 @@ | |
" - _target_: EnsureChannelFirstd\n", | ||
" keys: 'image'\n", | ||
" - _target_: ScaleIntensityd\n", | ||
" keys: 'image'\n", | ||
" " | ||
" keys: 'image'" | ||
] | ||
}, | ||
{ | ||
|
@@ -369,19 +370,19 @@ | |
" num_workers: 4\n", | ||
"\n", | ||
"trainer:\n", | ||
" _target_: SupervisedTrainer\n", | ||
" device: '@device'\n", | ||
" max_epochs: '@max_epochs'\n", | ||
" train_data_loader: '@train_dl'\n", | ||
" network: '@net'\n", | ||
" optimizer: \n", | ||
" _target_: torch.optim.Adam\n", | ||
" params: '[email protected]()'\n", | ||
" lr: 0.00001 # learning rate set slow so that you can see network improvement over epochs\n", | ||
" loss_function: \n", | ||
" _target_: torch.nn.CrossEntropyLoss\n", | ||
" inferer: \n", | ||
" _target_: SimpleInferer\n", | ||
" _target_: SupervisedTrainer\n", | ||
" device: '@device'\n", | ||
" max_epochs: '@max_epochs'\n", | ||
" train_data_loader: '@train_dl'\n", | ||
" network: '@net'\n", | ||
" optimizer: \n", | ||
" _target_: torch.optim.Adam\n", | ||
" params: '[email protected]()'\n", | ||
" lr: 0.00001 # learning rate set slow so that you can see network improvement over epochs\n", | ||
" loss_function: \n", | ||
" _target_: torch.nn.CrossEntropyLoss\n", | ||
" inferer: \n", | ||
" _target_: SimpleInferer\n", | ||
"\n", | ||
"train:\n", | ||
"- '[email protected]()'\n", | ||
|
@@ -527,8 +528,7 @@ | |
" prob = result.detach().to(\"cpu\")[0]\n", | ||
" pred = class_names[prob.argmax()]\n", | ||
" gt = item[\"class_name\"][0]\n", | ||
" print(f\"Prediction: {pred}. Ground-truth: {gt}\")\n", | ||
" " | ||
" print(f\"Prediction: {pred}. Ground-truth: {gt}\")\n" | ||
] | ||
}, | ||
{ | ||
|
@@ -543,7 +543,9 @@ | |
"cell_type": "code", | ||
"execution_count": 9, | ||
"id": "b4e1f99a-a68b-4aeb-bcf2-842f26609b52", | ||
"metadata": {}, | ||
"metadata": { | ||
"lines_to_next_cell": 2 | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.