Philip E Blair
77f6aa43e5
Fix: Allow hashing of metrics with lists in their state ( #5939 )
...
* Fix: Allow hashing of metrics with lists in their state
* Add test case and modify semantics of Metric __hash__ in order to be compatible with structural equality checks
* Fix pep8 style issue
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-18 09:54:12 +00:00
manipopopo
6a9cec41a3
Add `dim` to `pytorch_lightning.metrics.PSNR` ( #5957 )
...
* Add dim to PSNR
* Update CHANGELOG.md
* Update CHANGELOG.md
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Add reduction tests
* Recover warnings on reduction and add tests
* Add copyright texts
* Refactor PSNR
* Change warnings
* Update pytorch_lightning/metrics/functional/psnr.py
Change functional.psnr dim doc
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Change PSNR dim docs
* Apply suggestions from code review
* tests
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2021-02-17 11:55:40 +01:00
Jirka Borovec
9dd56398e3
fixing some compatibility with PT 1.8 ( #5864 )
...
* change default
* .
* p
* 0.21.2
* .
* fix
* .
2021-02-09 18:25:57 +01:00
Jirka Borovec
bd920b4102
Refactor simplify tests ( #5861 )
...
* add new
* restructure
* yapf
* move
* fix
2021-02-08 11:52:02 +01:00
Jirka Borovec
a53c6d1319
yapf tests metrics ( #5845 )
2021-02-06 11:41:40 -05:00
Nicki Skafte
605c5a8c9a
Fix `num_classes` arg in F1 metric ( #5663 )
...
* fix f1 metric
* Apply suggestions from code review
* chlog
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2021-02-05 21:40:30 +01:00
manipopopo
97e1516349
Fix Metric.state_dict ( #5614 )
...
* Fix Metric.state_dict
* Update CHANGELOG.md
* Update CHANGELOG.md
* Detach tensors in a list if needed
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit e87424adfb
)
2021-02-04 20:55:41 +01:00
yuntai
50fd4879a9
Update metrics to use Enum ( #5689 )
...
- Add DataType, AverageMethod and MDMCAverageMethod
2021-02-01 13:50:10 -05:00
Nicki Skafte
221c4a0ba2
[Metrics] AUC/AUROC class interface ( #5479 )
...
* base files
* auc done
* init files
* auc class interface
* fixing auc
* more fixes
* working auroc
* update auc
* add docs
* remove leftovers from merge
* suggestions
* fix f-string
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* add deprecated tests
* make logic clearer
* Update pytorch_lightning/metrics/classification/auroc.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* fix
* fix
* fix docs
* fix isort
* fix deprecated test
* fix tests
* fix tests
* fix isort
* Apply suggestions from code review
* add enum
* deprecate old impl
* update from suggestions
* chlog
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2021-01-27 08:16:54 -05:00
Jirka Borovec
86d905c205
hotfix: skip unsupported metric compostions ( #5664 )
...
* skip PT unsupported compositions
* flake8
2021-01-26 20:24:15 +01:00
Justus Schock
8c55a08e85
Compositional metrics ( #5464 )
...
* implement compositional metrics
* implement composition functions for metrics
* test compositions
* docs
* pytest
* pep8
* fix argument resolution
* return all kwargs if filtering not possible
* fix typo
* implement hashing
* Update pytorch_lightning/metrics/compositional.py
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Update docs/source/metrics.rst
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* add representation
* Apply suggestions from code review
* Update docs/source/metrics.rst
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* chlog
* flake8
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2021-01-26 11:56:12 -05:00
Tadej Svetina
c8f605e47d
Classification metrics overhaul: precision & recall (4/n) ( #4842 )
...
* Add stuff
* Change metrics documentation layout
* Add stuff
* Add stat scores
* Change testing utils
* Replace len(*.shape) with *.ndim
* More descriptive error message for input formatting
* Replace movedim with permute
* PEP 8 compliance
* WIP
* Add reduce_scores function
* Temporarily add back legacy class_reduce
* Division with float
* PEP 8 compliance
* Remove precision recall
* Replace movedim with permute
* Add back tests
* Add empty newlines
* Add precision recall back
* Add empty line
* Fix permute
* Fix some issues with old versions of PyTorch
* Style changes in error messages
* More error message style improvements
* Fix typo in docs
* Add more descriptive variable names in utils
* Change internal var names
* Revert unwanted changes
* Revert unwanted changes pt 2
* Update metrics interface
* Add top_k parameter
* Add back reduce function
* Add stuff
* PEP3
* Add depreciation
* PEP8
* Deprecate param
* PEP8
* Fix and simplify testing for older PT versions
* Update Changelog
* Remove redundant import
* Add tests to increase coverage
* Remove zero_division
* fix zero_division
* Add zero_div + edge case tests
* Reorder cls metric args
* Add back quotes for is_multiclass
* Add precision_recall and tests
* PEP8
* Fix docs
* Fix docs
* Update
* Change precision_recall output
* PEP8/isort
* Add method _get_final_stats
* Fix depr test
* Add comment to deprecation tests
* isort
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Add typing to test
* Add matc str to pytest.raises
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-01-18 03:24:13 -05:00
Arnaud Gelas
d8a0c7d82a
Fix pre-commit isort failure on tests/metrics/*.py ( #5424 )
...
* Remove tests.metrics from skipped module in pyproject.toml
* Fix pre-commit isort failure on tests/metrics/*.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-01-14 06:05:28 -05:00
Nicki Skafte
02acb21e55
[Metrics] Disable default reset after compute ( #5409 )
...
* reset
* self._cache -> cache (make cache local variable so it is not overwritten)
* pep8
* fix metric result integration
* rm print statements
* better comment
* changelog
* Update docs/source/metrics.rst
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
2021-01-13 04:01:08 -05:00
deng-cy
3ee1b55bf1
Reformat iou [func] and add IoU class ( #4704 )
...
* added Iou
* Create iou.py
* Update iou.py
* Update iou.py
* Update CHANGELOG.md
* Update metrics.rst
* Update iou.py
* Update iou.py
* Update __init__.py
* Update iou.py
* Update iou.py
* Update classification.py
* Update classification.py
* Update classification.py
* Update __init__.py
* Update __init__.py
* Update iou.py
* Update classification.py
* Update metrics.rst
* Update CHANGELOG.md
* Update CHANGELOG.md
* add iou
* add test
* add test
* removed iou
* add iou
* add iou test
* add float
* reformat test_iou
* removed test_iou
* updated format
* updated format
* Update CHANGELOG.md
* updated format
* Update metrics.rst
* Apply suggestions from code review
merge suggestions
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* added equations
* reformat init
* change format
* change format
* deprecate iou and test for this
* fix changelog
* delete iou test in test_classification
* format change
* format change
* format
* format
* format
* delete white space
* delete white space
* fix tests
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* better deprecation
* fix docs
* Apply suggestions from code review
* fix todo
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-01-08 13:36:08 +00:00
Nicki Skafte
06668c0ddf
[Metrics] MetricCollection ( #4318 )
...
* docs + precision + recall + f_beta + refactor
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* rebase
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* fixes
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* added missing file
* docs
* docs
* extra import
* add metric collection
* add docs + integration with log_dict
* add test
* update
* update
* more test
* more test
* pep8
* fix doctest
* pep8
* add clone method
* add clone method
* merge-2
* changelog
* kwargs filtering and tests
* pep8
* fix test
* update docs
* Update docs/source/metrics.rst
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
* fix docs
* fix tests
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* fix docs
* fix doctest
* fix doctest
* fix doctest
* fix doctest
Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-01-08 11:09:07 +01:00
Pranjal Datta
06f36092a4
added image-gradients ( #4763 ) [1/2] ( #5056 )
...
* added iamge-gradients (#4763 )
* fixed tests code format
* made recommended fixes
* removed explicit device flags
* tried to fix doctest failure
* pep8 and doctest fixes
* added to docs/metrics
* updated CHANGELOG
* added the noqa flag
* added suggested modification to changelog
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* recommended update to docstring
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* removed device from docstring
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* made recommended fixes
* Update CHANGELOG.md
* Apply suggestions from code review
* added 1-line docstrings
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
2021-01-07 20:34:38 +01:00
Tadej Svetina
4292fe0532
Fix metric state reset ( #5273 )
...
* Fix metric state reset
* Fix test
* Improve formatting
Co-authored-by: Ananya Harsh Jha <ananya@pytorchlightning.ai>
(cherry picked from commit 4913cbb987
)
2021-01-06 12:48:01 +01:00
Nicki Skafte
9dbdffca1e
[Metrics] R2Score ( #5241 )
...
* add r2metric
* change init
* add test
* add docs
* add math
* Apply suggestions from code review
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* changelog
* adjusted parameter
* add more test
* pep8
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* add warnings for adjusted score
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2021-01-01 12:23:19 +01:00
Tadej Svetina
7f71ee9265
Classification metrics overhaul: stat scores (3/n) ( #4839 )
...
* Add stuff
* Change metrics documentation layout
* Add stuff
* Add stat scores
* Change testing utils
* Replace len(*.shape) with *.ndim
* More descriptive error message for input formatting
* Replace movedim with permute
* PEP 8 compliance
* WIP
* Add reduce_scores function
* Temporarily add back legacy class_reduce
* Division with float
* PEP 8 compliance
* Remove precision recall
* Replace movedim with permute
* Add back tests
* Add empty newlines
* Add empty line
* Fix permute
* Fix some issues with old versions of PyTorch
* Style changes in error messages
* More error message style improvements
* Fix typo in docs
* Add more descriptive variable names in utils
* Change internal var names
* Break down error checking for inputs into separate functions
* Remove the (N, ..., C) option in MD-MC
* Simplify select_topk
* Remove detach for inputs
* Fix typos
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update docs/source/metrics.rst
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Minor error message changes
* Update pytorch_lightning/metrics/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Reuse case from validation in formatting
* Refactor code in _input_format_classification
* Small improvements
* PEP 8
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source/metrics.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Alphabetical reordering of regression metrics
* Change default value of top_k and add error checking
* Extract basic validation into separate function
* Update to new top_k default
* Update desciption of parameters in input formatting
* Apply suggestions from code review
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Check that probabilities in preds sum to 1 (for MC)
* Fix coverage
* Split accuracy and hamming loss
* Remove old redundant accuracy
* Minor changes
* Fix imports
* Improve docstring descriptions
* Fix imports
* Fix edge case and simplify testing
* Fix docs
* PEP8
* Reorder imports
* Add top_k parameter
* Update changelog
* Update docstring
* Update docstring
* Reverse formatting changes for tests
* Change parameter order
* Remove formatting changes 2/2
* Remove formatting 3/3
* .
* Improve description of top_k parameter
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Remove unneeded assert
* Update pytorch_lightning/metrics/functional/accuracy.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Remove unneeded assert
* Explicit checking of parameter values
* Apply suggestions from code review
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Apply suggestions from code review
* Fix top_k checking
* PEP8
* Don't check dist_sync in test
* add back check_dist_sync_on_step
* Make sure half-precision inputs are transformed (#5013 )
* Fix typo
* Rename hamming loss to hamming distance
* Fix tests for half precision
* Fix docs underline length
* Fix doc undeline length
* Replace mdmc_accuracy parameter with subset_accuracy
* Update changelog
* Fix unwanted accuracy change
* Enable top_k for ML prob inputs
* Test that default threshold is 0.5
* Fix typo
* Update top_k description in helpers
* updates
* Update styling and add back tests
* Remove excess spaces
* fix torch.where for old versions
* fix linting
* Update docstring
* Fix docstring
* Apply suggestions from code review (mostly docs)
* Default threshold to None, accept only (0,1)
* Change wrong threshold message
* Improve documentation and add tests
* Add back ddp tests
* Change stat reduce method and default
* Remove DDP tests and fix doctests
* Fix doctest
* Update changelog
* Refactoring
* Fix typo
* Refactor
* Increase coverage
* Fix linting
* Consistent use of backticks
* Fix too long line in docs
* Apply suggestions from code review
* Fix deprecation test
* Fix deprecation test
* Default threshold back to 0.5
* Minor documentation fixes
* Add types to tests
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2020-12-30 20:49:50 +01:00
Prudhvi Rampey
2094633181
Implement partial auroc metric ( #3790 )
...
* Implement partial auroc metric
* Add pycodestyle changes
* Added tests for max_fpr
* changelog
* version for tests
* fix imports
* fix tests
* fix tests
* Added more thresholds in (0,1] to test max_fpr
* Removed deprecated 'reorder' param from auroc
* changelog
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* remove old structure
* Apply suggestions from code review
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* fix test error
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2020-12-29 19:10:19 +01:00
Tadej Svetina
ccffc344ca
Classification metrics overhaul: accuracy metrics (2/n) ( #4838 )
...
* Add stuff
* Change metrics documentation layout
* Add stuff
* Change testing utils
* Replace len(*.shape) with *.ndim
* More descriptive error message for input formatting
* Replace movedim with permute
* PEP 8 compliance
* Division with float
* Style changes in error messages
* More error message style improvements
* Fix typo in docs
* Add more descriptive variable names in utils
* Change internal var names
* Break down error checking for inputs into separate functions
* Remove the (N, ..., C) option in MD-MC
* Simplify select_topk
* Remove detach for inputs
* Fix typos
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update docs/source/metrics.rst
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Minor error message changes
* Update pytorch_lightning/metrics/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Reuse case from validation in formatting
* Refactor code in _input_format_classification
* Small improvements
* PEP 8
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source/metrics.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Alphabetical reordering of regression metrics
* Change default value of top_k and add error checking
* Extract basic validation into separate function
* Update to new top_k default
* Update desciption of parameters in input formatting
* Apply suggestions from code review
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Check that probabilities in preds sum to 1 (for MC)
* Fix coverage
* Split accuracy and hamming loss
* Remove old redundant accuracy
* Minor changes
* Fix imports
* Improve docstring descriptions
* Fix edge case and simplify testing
* Fix docs
* PEP8
* Reorder imports
* Update changelog
* Update docstring
* Update docstring
* Reverse formatting changes for tests
* Change parameter order
* Remove formatting changes 2/2
* Remove formatting 3/3
* .
* Improve description of top_k parameter
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Remove unneeded assert
* Update pytorch_lightning/metrics/functional/accuracy.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Remove unneeded assert
* Explicit checking of parameter values
* Apply suggestions from code review
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Apply suggestions from code review
* Fix top_k checking
* PEP8
* Don't check dist_sync in test
* add back check_dist_sync_on_step
* Make sure half-precision inputs are transformed (#5013 )
* Fix typo
* Rename hamming loss to hamming distance
* Fix tests for half precision
* Fix docs underline length
* Fix doc undeline length
* Replace mdmc_accuracy parameter with subset_accuracy
* Update changelog
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Suggestions from code review
* Fix number in docs
* Update pytorch_lightning/metrics/classification/accuracy.py
* Replace topk by argsort in select_topk
* Fix changelog
* Add test for wrong params
* Add Google Colab badges (#5111 )
* Add colab badges to notebook
Add colab badges to notebook to notebooks 4 & 5
* Add colab badges
Co-authored-by: chaton <thomas@grid.ai>
* Fix hanging metrics tests (#5134 )
* Use torch.topk again as ddp hanging tests fixed in #5134
* Fix unwanted notebooks change
* Fix too long line in hamming_distance
* Apply suggestions from code review
* Apply suggestions from code review
* protect
* Update CHANGELOG.md
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Roger Shieh <sh.rog@protonmail.ch>
Co-authored-by: Shachar Mirkin <shacharmirkin@gmail.com>
2020-12-21 16:42:51 +01:00
Jirka Borovec
0f36525e8f
fix/enable - check F401 ( #5201 )
...
* refactor - check F401
* missed
* fix
2020-12-21 10:15:04 +01:00
Jirka Borovec
35fd6e93c7
refactor - check E501 ( #5200 )
2020-12-21 14:23:09 +05:30
Jirka Borovec
6d2c564bc6
refactor - check F841 ( #5202 )
2020-12-21 11:10:55 +05:30
Jirka Borovec
74171efadf
drop duplicate metrics ( #5014 )
...
* drop duplicate metrics
* keep
* fix
2020-12-11 18:42:53 +01:00
Tadej Svetina
fedc0d1360
Classification metrics overhaul: input formatting standardization (1/n) ( #4837 )
...
* Add stuff
* Change metrics documentation layout
* Change testing utils
* Replace len(*.shape) with *.ndim
* More descriptive error message for input formatting
* Replace movedim with permute
* Style changes in error messages
* More error message style improvements
* Fix typo in docs
* Add more descriptive variable names in utils
* Change internal var names
* Break down error checking for inputs into separate functions
* Remove the (N, ..., C) option in MD-MC
* Simplify select_topk
* Remove detach for inputs
* Fix typos
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Update docs/source/metrics.rst
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Minor error message changes
* Update pytorch_lightning/metrics/utils.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* Reuse case from validation in formatting
* Refactor code in _input_format_classification
* Small improvements
* PEP 8
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update docs/source/metrics.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Update pytorch_lightning/metrics/classification/utils.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Apply suggestions from code review
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* Alphabetical reordering of regression metrics
* Change default value of top_k and add error checking
* Extract basic validation into separate function
* Update desciption of parameters in input formatting
* Apply suggestions from code review
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
* Check that probabilities in preds sum to 1 (for MC)
* Fix coverage
* Minor changes
* Fix edge case and simplify testing
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-12-07 17:49:35 +01:00
Nicki Skafte
1b40a4053d
Auto convert to contiguous format for all_gather ( #4907 )
...
* convert memory format
* changelog
* formatting
* suggestions
* retrigger tests
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
2020-12-05 15:49:45 +01:00
Nicki Skafte
bf7c28cd54
[Metrics] PrecisionRecallCurve, ROC and AveragePrecision class interface ( #4549 )
...
* initial changes
* remove old
* init files
* add average precision
* add precision_recall_curve
* add roc
* cleaning
* docs
* pep8
* docs
* pep8
* changelog
* examples prune duplicate roc
* format
* imports
* fix
* format
* flake8
* duplicate
* fix
* flake8
* docs
* docs
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka Borovec <jirka.borovec@seznam.cz>
2020-12-04 22:42:23 +01:00
Adrian Wälchli
fb0278a457
Update test for logging a metric object and state reset ( #4825 )
...
* update test
* docstring
Co-authored-by: Ananya Harsh Jha <ananya@pytorchlightning.ai>
2020-11-24 11:28:02 +01:00
Nicki Skafte
6831ba9aa0
[Metrics] Unification of FBeta ( #4656 )
...
* implementation
* init files
* more stable reduction
* add tests
* docs
* remove old implementation
* pep8
* changelog
* Apply suggestions from code review
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-11-23 09:44:35 +01:00
Jeff Yang
c36121326d
[metrics] Update SSIM ( #4566 )
...
* [metrics] Update SSIM
* [metrics] Update SSIM
* [metrics] Update SSIM
* [metrics] Update SSIM
* [metrics] update ssim
* dist_sync_on_step True
* [metrics] update ssim
* Update tests/metrics/regression/test_ssim.py
Co-authored-by: chaton <thomas@grid.ai>
* Update pytorch_lightning/metrics/functional/ssim.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* ddp=True
* Update test_ssim.py
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-11-19 11:51:18 +06:30
Nicki Skafte
51097669b9
[metrics] change default behaviour of state dict ( #4685 )
...
* fix state dict
* Update docs/source/metrics.rst
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
* changelog
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: chaton <thomas@grid.ai>
2020-11-16 12:33:45 +00:00
Nicki Skafte
465ec752f8
Metric ddp bugfix ( #4482 )
...
* changes
* fix spelling
* small note
* trying to fix ddp test
* fix ddp
* fix for test
* suggestion
* CHANGELOG
* Update pytorch_lightning/metrics/metric.py
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
Co-authored-by: Sean Naren <sean@grid.ai>
2020-11-10 09:16:31 +01:00
ananthsub
5d08559c03
Avoid torchscript export for Metric forward ( #4428 )
...
* Update metric.py
* add test
* Update CHANGELOG.md
* Update test_metric_lightning.py
* Update test_metric_lightning.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-11-03 23:02:02 +01:00
Dusan Drevicky
38bb4e2da0
[Metrics] Add multiclass auroc ( #4236 )
...
* Add functional multiclass AUROC metric
* Add multiclass_auroc tests
* fixup! Add functional multiclass AUROC metric
* fixup! fixup! Add functional multiclass AUROC metric
* Add multiclass_auroc doc reference
* Update CHANGELOG
* formatting
* Shorter error message regex match in tests
* Set num classes as pytest parameter
* formatting
* Update CHANGELOG
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
2020-10-30 19:56:13 +01:00
Jeff Yang
0f584faa6b
PyTorch 1.7 Stable support ( #3821 )
...
* prepare for 1.7 support [ci skip]
* tpu [ci skip]
* test run 1.7
* all 1.7, needs to fix tests
* couple with torchvision
* windows try
* remove windows
* 1.7 is here
* on purpose fail [ci skip]
* return [ci skip]
* 1.7 docker
* back to normal [ci skip]
* change to some_val [ci skip]
* add seed [ci skip]
* 4 places [ci skip]
* fail on purpose [ci skip]
* verbose=True [ci skip]
* use filename to track
* use filename to track
* monitor epoch + changelog
* Update tests/checkpointing/test_model_checkpoint.py
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Sean Naren <sean.narenthiran@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2020-10-30 15:42:14 +00:00
Nicki Skafte
e0b856c105
[Metrics] Confusion matrix class interface ( #4348 )
...
* docs + precision + recall + f_beta + refactor
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* rebase
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* fixes
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* added missing file
* docs
* docs
* extra import
* add confusion matrix
* add to docs
* add test
* pep8 + isort
* update tests
* move util function
* unify functional and class
* add to init
* remove old implementation
* update tests
* pep8
* add duplicate
* fix doctest
* Update pytorch_lightning/metrics/classification/confusion_matrix.py
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
* changelog
* bullet point args
* bullet docs
* bullet docs
Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: chaton <thomas@grid.ai>
Co-authored-by: Roger Shieh <55400948+s-rog@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2020-10-30 11:44:25 +01:00
Nicki Skafte
a937394312
[Metrics] Unification of regression ( #4166 )
...
* moved to utility
* add files
* unify
* add desc
* update
* end of line
* Apply suggestions from code review
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
* add back functional test in new interface
* pep8
* doctest fix
* test name fix
* unify psnr + add class psnr, TODO: psnr test refactor ala mean squared error
* unify psnr
* rm unused code
* pep8
* docs
* unify ssim
* lower tolerance for ssim
* fix import
* pep8
* docs
* flake8
* test smaller images
* trying to fix test
* no ddp test for ssim
* pep8
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
2020-10-21 18:05:59 -04:00
Dusan Drevicky
96785b99df
Feature/4244 iou input expectations ( #4261 )
...
* =Add iou input checks
* =Add test for iou input checks
* =Update docstring for iou pred and target
2020-10-21 09:01:24 -04:00
Abhinav Gupta
5d1583d7f2
Corrected f_beta computation ( #4183 )
...
* Update f_beta.py
Added METRIC_EPS in the denominator to avoid nan values in f_beta score.
* Update f_beta.py
Made changes flake8 compliant
* Update f_beta.py
Makes use of class_reduce for macro f_beta computation to avoid nans
* Update f_beta.py
Made flake8 compliant
* Corrected F beta computation
* Removed offset to make the computation precise
2020-10-21 10:52:04 +02:00
Jirka Borovec
f37444fa3e
CI: add flake8 ( #4239 )
2020-10-19 21:20:17 +01:00
Teddy Koker
827a557269
Add persistent flag to Metric.add_state ( #4195 )
...
* add persistant flag to add_state in metrics
* wrap register_buffer with try catch
* pep8
* use loose version
* test
* pep8
2020-10-16 14:36:03 -04:00
Jirka Borovec
4290c9e1e8
Tests: clean metrics ( #4152 )
...
* namme inputs
* sk rename
* imports
2020-10-15 07:50:08 +02:00
Nicki Skafte
edcb6e49b9
Speedup of metric tests ( #4122 )
...
* speedup
* something working
* update the rest
* more desc
* recurse tests/metrics again
* pep8
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
2020-10-14 13:51:58 -04:00
Jirka Borovec
2c3b512c50
reverted "temporary drop metrics tests while speeding them up" and SKIP ( #4115 )
...
* Revert "temporary drop metrics tests while speeding them up (#4071 )"
This reverts commit 86c70622fb
.
* skip metrics tests
* skipping
2020-10-14 19:01:43 +02:00
William Falcon
86c70622fb
temporary drop metrics tests while speeding them up ( #4071 )
2020-10-11 07:38:58 -04:00
Ananya Harsh Jha
ae8772490d
classification metrics ( #4043 )
...
* docs + precision + recall + f_beta + refactor
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* rebase
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* fixes
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
* added missing file
* docs
* docs
* extra import
Co-authored-by: Teddy Koker <teddy.koker@gmail.com>
2020-10-10 12:31:00 -04:00
Nicki Skafte
8a3c800641
Update explained variance metric ( #4024 )
...
* update metrics
* pep8
* Update pytorch_lightning/metrics/regression/explained_variance.py
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
* add typing for testing utils
* change from assert to raise exception
* add test for raised shape error
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-10-09 19:23:12 -04:00
Teddy Koker
b961e12f50
Implement Explained Variance Metric + metric fix ( #4013 )
...
* metric fix, explained variance
* one more test
* pep8
* remove comment
* fix add_state condition
Co-authored-by: ananyahjha93 <ananya@pytorchlightning.ai>
2020-10-08 22:58:33 -04:00