Support list of tensors in Metrics
See original GitHub issue🚀 Feature
Related to discussion from here: https://github.com/Project-MONAI/MONAI/issues/2220#issuecomment-849250700
The feature request is to support list of tensors or scalars as input for metrics: a) classification problem:
acc = Accuracy()
output = (
[torch.rand(10), torch.rand(10), torch.rand(10)], # predictions
[4, 5, 1], # ground truth
)
acc.update(output)
print(acc.compute())
b) segmentation problem:
acc = Accuracy()
output = (
[torch.rand(10, 32, 32), torch.rand(10, 40, 30), torch.rand(10, 30, 24)], # predictions
[torch.randint(0, 10, size=(32, 32)), torch.randint(0, 10, size=(40, 30)), torch.randint(0, 10, size=(30, 24))], # ground truth
)
acc.update(output)
print(acc.compute())
c) Same for API with Engine.
cc @Nic-Ma
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Structure Overview — PyTorch-Metrics 0.11.0 documentation
This pattern is implemented for the following operators (with a being metrics and b being metrics, tensors, integer or floats):. Addition ( a...
Read more >monai.metrics.metric — MONAI 0.7.0 Documentation
It can support both `list of channel-first Tensor` and `batch-first Tensor`. And users can execute on every batch of data, then accumulate the...
Read more >tfr.keras.metrics.OPAMetric - Ranking - TensorFlow
This method can be used inside a subclassed layer or model's call function, in which case losses should be a Tensor or list...
Read more >Two-Dimensional Tensors in Pytorch
Let's demonstrate by converting a 2D list of integers to a 2D tensor object. As an example, we'll create a 2D list and...
Read more >API reference — TensorLy: Tensor Learning in Python
While in some backends (e.g. NumPy), you can directly combine indexing and assignement, not all backends support this. Instead of tensor[indices] = values ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think once we are OK with details on what to add, we can try to implement it and schedule for this release.
Sounds great!
Thanks for your update.