You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [WIP] Added cifar10 distributed example
* [WIP] Metric with all reduce decorator and tests
* [WIP] Added tests for accumulation metric
* [WIP] Updated with reinit_is_reduced
* [WIP] Distrib adaptation for other metrics
* [WIP] Warnings for EpochMetric and Precision/Recall when distrib
* Updated metrics and tests to run on distributed configuration
- Test on 2 GPUS single node
- Added cmd in .travis.yml to indicate how to test locally
- Updated travis to run tests in 4 processes
* Minor fixes and cosmetics
* Fixed bugs and improved contrib/cifar10 example
* Updated docs
* Fixes issue #543 (#572)
* Fixes issue #543
Previous CM implementation suffered from the problem if target contains non-contiguous indices.
New implementation is almost taken from torchvision's https://github.com/pytorch/vision/blob/master/references/segmentation/utils.py#L75-L117
This commit also removes the case of targets as (batchsize, num_categories, ...) where num_categories excludes background class.
Confusion matrix computation is possible almost similarly for (batchsize, ...), but when target is all zero (0, ..., 0) = no classes (background class),
then confusion matrix does not count any true/false predictions.
* Update confusion_matrix.py
* Update metrics.rst
* Updated docs and set device as "cuda" in distributed instead of raising error
* [WIP] Fix missing _is_reduced in precision/recall with tests
* Updated other tests
* Added mlflow logger (#558)
* Added mlflow logger without tests
* Added mlflow tests, updated mlflow logger code and other tests
* Updated docs and added mlflow in travis
* Added tests for mlflow OptimizerParamsHandler
- additionally added OptimizerParamsHandler for plx with tests
* Update to PyTorch v1.2.0 (#580)
* Update .travis.yml
* Update .travis.yml
* Fixed tests and improved travis
* Fix SSL problem of failing travis (#581)
* Update .travis.yml
* Update .travis.yml
* Fixed tests and improved travis
* Fixes SSL problem to download model weights
* Fixed travis for deploy and nightly
* Fixes#583 (#584)
* Fixes docs build warnings (#585)
* Return removable handle from Engine.add_event_handler(). (#588)
* Add tests for event removable handle.
Add feature tests for engine.add_event_handler returning removable event
handles.
* Return RemovableEventHandle from Engine.add_event_handler.
* Fixup removable event handle test in python 2.7.
Explicitly trigger gc, allowing cycle detection between engine and
state, in removable handle weakref test. Python 2.7 cycle detection
appears to be less aggressive than python 3+.
* Add removable event handler docs.
Add autodoc configuration for RemovableEventHandler, expand "concepts"
documentation with event remove example following event add example.
* Update concepts.rst
* Updated travis and renamed tbptt test gpu -> cuda
Copy file name to clipboardExpand all lines: docs/source/contrib/handlers.rst
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,29 @@ tensorboard_logger
23
23
:members:
24
24
:inherited-members:
25
25
26
+
See `tensorboardX mnist example <https://github.com/pytorch/ignite/blob/master/examples/contrib/mnist/mnist_with_tensorboard_logger.py>`_
27
+
and `CycleGAN and EfficientNet notebooks <https://github.com/pytorch/ignite/tree/master/examples/notebooks>`_ for detailed usage.
Metrics could be combined together to form new metrics. This could be done through arithmetics, such
41
64
as ``metric1 + metric2``, use PyTorch operators, such as ``(metric1 + metric2).pow(2).mean()``,
42
65
or use a lambda function, such as ``MetricsLambda(lambda a, b: torch.mean(a + b), metric1, metric2)``.
43
66
44
67
For example:
45
68
46
-
.. code-block:: python
69
+
.. code-block:: python
47
70
48
-
precision = Precision(average=False)
49
-
recall = Recall(average=False)
50
-
F1 = (precision * recall *2/ (precision + recall)).mean()
71
+
precision = Precision(average=False)
72
+
recall = Recall(average=False)
73
+
F1 = (precision * recall *2/ (precision + recall)).mean()
51
74
52
-
.. note:: This example computes the mean of F1 across classes. To combine
53
-
precision and recall to get F1 or other F metrics, we have to be careful
54
-
that `average=False`, i.e. to use the unaveraged precision and recall,
55
-
otherwise we will not be computing F-beta metrics.
75
+
.. note:: This example computes the mean of F1 across classes. To combine
76
+
precision and recall to get F1 or other F metrics, we have to be careful
77
+
that `average=False`, i.e. to use the unaveraged precision and recall,
78
+
otherwise we will not be computing F-beta metrics.
56
79
57
80
Metrics also support indexing operation (if metric's result is a vector/matrix/tensor). For example, this can be useful to compute mean metric (e.g. precision, recall or IoU) ignoring the background:
58
81
59
-
.. code-block:: python
82
+
.. code-block:: python
83
+
84
+
cm = ConfusionMatrix(num_classes=10)
85
+
iou_metric = IoU(cm)
86
+
iou_no_bg_metric = iou_metric[:9] # We assume that the background index is 9
In the above example, `CustomAccuracy` constructor has `device` argument and `reset`, `update`, `compute` methods are decorated with `reinit_is_reduced`, `sync_all_reduce`. The purpose of these features is to adapt metrics in distributed computations on CUDA devices and assuming the backend to support `"all_reduce" operation <https://pytorch.org/docs/stable/distributed.html#torch.distributed.all_reduce>`_. User can specify the device (by default, `cuda`) at metric's initialization. This device _can_ be used to store internal variables on and to collect all results from all participating devices. More precisely, in the above example we added `@sync_all_reduce("_num_examples", "_num_correct")` over `compute` method. This means that when `compute` method is called, metric's interal variables `self._num_examples` and `self._num_correct` are summed up over all participating devices. Therefore, once collected, these internal variables can be used to compute the final metric value.
0 commit comments