Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Dropout rate of 50% is systematically applied in the V-Net even when dropout_prob is set to 0 #6116

Closed
BLmbert opened this issue Mar 8, 2023 · 2 comments · Fixed by #6768
Labels

Comments

@BLmbert
Copy link

BLmbert commented Mar 8, 2023

First of all thanks for this great repo !

I noticed that the segmentation performance of the V-Net was a step below other architectures (DynUNet, BasicUnetPlusPlus ...). By looking at the implementation, I noticed that a dropout rate of 50% is systematically applied (hard-coded) in the UpTransition layers of the V-Net, even the user sets dropout_prob to 0.

In monai.networks.nets.vnet :
self.dropout = dropout_type(dropout_prob) if dropout_prob is not None else None (l147)
--> self.dropout2 = dropout_type(0.5) (l148)

Expected behavior
It is expected that dropout is set to 0 when dropout_prob is set to 0 in the VNet class.

https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/nets/vnet.py

@Nic-Ma
Copy link
Contributor

Nic-Ma commented Mar 8, 2023

Hi @wyli ,

I think the original author of VNet already left our team, could you please help confirm this question?

Thanks in advance.

@wyli wyli added enhancement New feature or request Contribution wanted labels Mar 9, 2023
@KumoLiu
Copy link
Contributor

KumoLiu commented Mar 9, 2023

Hi @BLmbert, I just take a look at the original implementation. There are indeed two dropout rate in the net. The second dropout is hardcoded to 0.5 in the original implementation. Of course, we could also make the second dropout ratio more flexible as well. The dropout_prob the user set is used in Line 155
https://github.com/mattmacy/vnet.pytorch/blob/a00c8ea16bcaea2bddf73b2bf506796f70077687/vnet.py#L93-L94

Thanks!
cc @wyli @Nic-Ma

wyli pushed a commit that referenced this issue Jul 27, 2023
Fixes #6116 

### Description

Converts dropout probability from a Optional float to a Optional tuple
of floats.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Saurav Maheshkar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants