Skip to content

561 497 Provide metrics base APIs#2291

Merged
Nic-Ma merged 32 commits intoProject-MONAI:feature/561-metrics-apifrom
Nic-Ma:561-provide-metrics-base
Jun 6, 2021
Merged

561 497 Provide metrics base APIs#2291
Nic-Ma merged 32 commits intoProject-MONAI:feature/561-metrics-apifrom
Nic-Ma:561-provide-metrics-base

Conversation

@Nic-Ma
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma commented Jun 1, 2021

Description

This PR added base class for the metrics.
And add support for list of channel-first Tensor.
It's a non-breaking change.

Status

Ready

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

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

/black

@Nic-Ma Nic-Ma marked this pull request as ready for review June 2, 2021 11:31
@Nic-Ma Nic-Ma changed the title [WIP] 561 497 Provide metrics base APIs 561 497 Provide metrics base APIs Jun 2, 2021
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

Hi @vfdev-5 ,

This PR added the metric base class and support a list of tensors. Tried to align with your new metric API design.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

/black

@Nic-Ma Nic-Ma force-pushed the 561-provide-metrics-base branch from 9f3945f to 1372133 Compare June 2, 2021 15:59
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

/integration-test

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

Hi @wyli @rijobro @ericspod ,

This PR is ready for review now.

Thanks.

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 2, 2021

/black

Copy link
Copy Markdown
Contributor

@yiheng-wang-nv yiheng-wang-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, I left some comments above.

Copy link
Copy Markdown
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I put some initial comments, the metric base classes may need more work, let me check the evaluation working group discussions and think about this

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 3, 2021

/black

@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 3, 2021

/black

@Nic-Ma Nic-Ma changed the base branch from dev to feature/561-metrics-api June 6, 2021 00:22
@Nic-Ma
Copy link
Copy Markdown
Contributor Author

Nic-Ma commented Jun 6, 2021

As this is a very big feature update, I created a new branch: feature/561-metrics-api in the Project-MONAI repo.
I will merge this PR into that branch and create a new PR to dev branch.

Thanks.

@Nic-Ma Nic-Ma merged commit 6dfafdc into Project-MONAI:feature/561-metrics-api Jun 6, 2021
Nic-Ma added a commit that referenced this pull request Jun 11, 2021
* 561 497 Provide metrics base APIs (#2291)

* [DLMED] add metric base class

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update meandice and auc

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] extract reduce API

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update regression metrics

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update all the other metrics and enhance unit tests

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add doc-strings and update unit tests

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix pytype issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix all the mypy issues

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix integration test

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix pytype issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add more sanity check

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to Yiheng's comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to Wenqi's comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] change to "_compute()" and "aggregate()"

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add compute_list()

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>
Co-authored-by: Yiheng Wang <[email protected]>

* [DLMED] update according to comments

1. re-define base classes in 3 levels to make it more clear and flexible to extend
2. added self-contained variables in metrics to provide easier API
3. added reset() and sync() logic
4. added distributed data parallel logic for all the metrics

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] fix flake8 issue

Signed-off-by: Nic Ma <[email protected]>

* [MONAI] python code formatting

Signed-off-by: monai-bot <[email protected]>

* [DLMED] optimize base classes

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] simplify integration tests to use new APIs

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update based on comments

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] add synced=False in add()

Signed-off-by: Nic Ma <[email protected]>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <[email protected]>

* full ci/cd for feature branches

Signed-off-by: Wenqi Li <[email protected]>

* [DLMED] update aggregate()

Signed-off-by: Nic Ma <[email protected]>

Co-authored-by: monai-bot <[email protected]>
Co-authored-by: Yiheng Wang <[email protected]>
Co-authored-by: Wenqi Li <[email protected]>
@Nic-Ma Nic-Ma deleted the 561-provide-metrics-base branch July 2, 2021 23:38
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.

Additional Metric Interface to compute quantities over dataset

6 participants