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

5983 update to use np.linalg for the small affine inverse #5967

Merged
merged 11 commits into from
Feb 13, 2023

Conversation

wyli
Copy link
Contributor

@wyli wyli commented Feb 9, 2023

Signed-off-by: Wenqi Li wenqil@nvidia.com

Fixes #5983
Fixes #5696

Description

this PR tries to move away from the torch.linalg APIs for small inverse tasks where there's no need for making them differentiable
Screenshot 2023-02-09 at 23 42 15

Screenshot 2023-02-13 at 14 47 50

Types of changes

  • 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.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli marked this pull request as ready for review February 9, 2023 22:04
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
monai/networks/utils.py Show resolved Hide resolved
monai/networks/utils.py Outdated Show resolved Hide resolved
monai/transforms/spatial/array.py Show resolved Hide resolved
tests/testing_data/integration_answers.py Outdated Show resolved Hide resolved
@mingxin-zheng
Copy link
Contributor

I found some issue when I test this fix on PyTorch 22.10 on A100. The integration test test_integration_segmentation_3d.py did not pass.

2209.txt
2210.txt
2211.txt
2212.txt

@wyli wyli changed the title update to use np.linalg for the small affine inverse 5983 update to use np.linalg for the small affine inverse Feb 13, 2023
wyli and others added 2 commits February 13, 2023 08:14
Signed-off-by: Wenqi Li <wenqil@nvidia.com>

Fixes Project-MONAI#5762

### Description

limiting the number of printing lines

### 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).
- [x] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Project-MONAI#5965)

Fixes Project-MONAI#5964

### Description

Added callable options for iteration_log and epoch_log in StatsHandler.

Ref:
Project-MONAI#5958 (reply in thread)


### 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).
- [x] 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: vfdev-5 <vfdev.5@gmail.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: vfdev <vfdev.5@gmail.com>
Co-authored-by: Wenqi Li <wenqil@nvidia.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Wenqi Li <831580+wyli@users.noreply.github.com>
@wyli
Copy link
Contributor Author

wyli commented Feb 13, 2023

/build

1 similar comment
@wyli
Copy link
Contributor Author

wyli commented Feb 13, 2023

/build

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli
Copy link
Contributor Author

wyli commented Feb 13, 2023

/build

@wyli wyli enabled auto-merge (squash) February 13, 2023 17:59
@wyli wyli merged commit 3122e1a into Project-MONAI:dev Feb 13, 2023
@wyli wyli deleted the numpy-inverse branch February 21, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Torch.inverse should be replaced to achieve stable inverse result. multi-thread context torch.inverse
4 participants