Skip to content

Commit 1cee348

Browse files
Fix typo in multiple instance learning (#1158)
Fixes #1153. ### Description - Fix the typo in `ScaleIntensityRanged` https://github.com/Project-MONAI/tutorials/blob/e5a1876ec41be44ac7185b07768177110c316f52/pathology/multiple_instance_learning/panda_mil_train_evaluate_pytorch_gpu.py#L296 - update performance figures with correct normalization ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Avoid including large-size files in the PR. - [ ] 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: KumoLiu <yunl@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7c031bf commit 1cee348

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed
81.2 KB
Loading
86.5 KB
Loading
78.8 KB
Loading

pathology/multiple_instance_learning/panda_mil_train_evaluate_pytorch_gpu.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import collections.abc
314
import os
@@ -293,7 +304,7 @@ def main_worker(gpu, args):
293304
RandFlipd(keys=["image"], spatial_axis=0, prob=0.5),
294305
RandFlipd(keys=["image"], spatial_axis=1, prob=0.5),
295306
RandRotate90d(keys=["image"], prob=0.5),
296-
ScaleIntensityRanged(keys=["image"], a_min=np.float32(255), a_max=np.float32(0)),
307+
ScaleIntensityRanged(keys=["image"], a_min=np.float32(0), a_max=np.float32(255)),
297308
ToTensord(keys=["image", "label"]),
298309
]
299310
)
@@ -310,7 +321,7 @@ def main_worker(gpu, args):
310321
constant_values=255,
311322
),
312323
SplitDimd(keys=["image"], dim=0, keepdim=False, list_output=True),
313-
ScaleIntensityRanged(keys=["image"], a_min=np.float32(255), a_max=np.float32(0)),
324+
ScaleIntensityRanged(keys=["image"], a_min=np.float32(0), a_max=np.float32(255)),
314325
ToTensord(keys=["image", "label"]),
315326
]
316327
)

0 commit comments

Comments
 (0)