Skip to content

Commit

Permalink
Template Fix (Project-MONAI#530)
Browse files Browse the repository at this point in the history
### Description
A minor fix to the segmentation template to clarify usage.

### Status
**Ready**

### Please ensure all the checkboxes:
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Codeformat tests passed locally by running `./runtests.sh
--codeformat`.
- [ ] In-line docstrings updated.
- [ ] Update `version` and `changelog` in `metadata.json` if changing an
existing bundle.
- [ ] Please ensure the naming rules in config files meet our
requirements (please refer to: `CONTRIBUTING.md`).
- [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy`
are correct in `metadata.json`.
- [ ] Descriptions should be consistent with the content, such as
`eval_metrics` of the provided weights and TorchScript modules.
- [ ] Files larger than 25MB are excluded and replaced by providing
download links in `large_file.yml`.
- [ ] Avoid using path that contains personal information within config
files (such as use `/home/your_name/` for `"bundle_root"`).

---------

Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: YunLiu <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 3219cb7 commit 774023c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion models/segmentation_template/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
"version": "0.0.1",
"version": "0.0.2",
"changelog": {
"0.0.2": "Minor train.yaml clarifications",
"0.0.1": "Initial version"
},
"monai_version": "1.2.0",
Expand Down
8 changes: 4 additions & 4 deletions models/segmentation_template/configs/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ val_dataloader:
lossfn:
_target_: DiceLoss
include_background: true # if your segmentations are relatively small it might help for this to be false
to_onehot_y: true
softmax: true
to_onehot_y: true # convert ground truth to one-hot for training
softmax: true # softmax applied to prediction

# hyperparameters could be added for other arguments of this class
optimizer:
Expand All @@ -141,7 +141,7 @@ optimizer:
inferer:
_target_: SimpleInferer

# transform to apply to data from network to be suitable for loss function and validation
# transform to apply to data from network to be suitable for validation
postprocessing:
_target_: Compose
transforms:
Expand Down Expand Up @@ -235,7 +235,7 @@ trainer:
inferer: '@inferer' # unnecessary since SimpleInferer is the default if this isn't provided
loss_function: '@lossfn'
optimizer: '@optimizer'
postprocessing: '@postprocessing'
# postprocessing: '@postprocessing' # uncomment if you have train metrics that need post-processing
key_train_metric: null
train_handlers: '@handlers'

Expand Down

0 comments on commit 774023c

Please sign in to comment.