From d9eff9ce9a0cc11ee521a665433d953a2454b441 Mon Sep 17 00:00:00 2001 From: Josseline Perdomo Date: Wed, 7 Oct 2020 01:12:35 -0400 Subject: [PATCH 1/4] added links to reinit__is_reduced and sync_all_reduce decorators in metrics documentation --- docs/source/metrics.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst index 13ef7b3347e7..acd6ac00f1cb 100644 --- a/docs/source/metrics.rst +++ b/docs/source/metrics.rst @@ -229,11 +229,11 @@ Complete list of usages Metrics and distributed computations ------------------------------------ -In the above example, ``CustomAccuracy`` has ``reset``, ``update``, ``compute`` methods -decorated with ``reinit__is_reduced``, ``sync_all_reduce``. The purpose of these features is to adapt metrics in distributed -computations on supported backend and devices (:doc:`distributed`). 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 +In the above example, ``CustomAccuracy`` has ``reset``, ``update``, ``compute`` methods decorated +with :meth:`~ignite.metrics.metric.reinit__is_reduced`, :meth:`ignite.metrics.metric.sync_all_reduce`. The purpose of these features is to adapt metrics in distributed +computations on supported backend and devices (see :doc:`distributed` for more details). 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. Complete list of metrics @@ -256,12 +256,15 @@ Complete list of metrics - :class:`~ignite.metrics.MetricsLambda` - :class:`~ignite.metrics.Precision` - :class:`~ignite.metrics.Recall` + - :meth:`~ignite.metrics.metric.reinit__is_reduced` - :class:`~ignite.metrics.RootMeanSquaredError` - :class:`~ignite.metrics.RunningAverage` - :class:`~ignite.metrics.SSIM` + - :meth:`~ignite.metrics.metric.sync_all_reduce` - :class:`~ignite.metrics.TopKCategoricalAccuracy` - :class:`~ignite.metrics.VariableAccumulation` + .. currentmodule:: ignite.metrics .. autoclass:: Accuracy From 33e3aa176ecedae4df47d2734571f58b69808da5 Mon Sep 17 00:00:00 2001 From: Josseline Perdomo Date: Wed, 7 Oct 2020 11:58:09 -0400 Subject: [PATCH 2/4] updated order in list of metrics --- docs/source/metrics.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst index acd6ac00f1cb..909418373bc6 100644 --- a/docs/source/metrics.rst +++ b/docs/source/metrics.rst @@ -256,13 +256,13 @@ Complete list of metrics - :class:`~ignite.metrics.MetricsLambda` - :class:`~ignite.metrics.Precision` - :class:`~ignite.metrics.Recall` - - :meth:`~ignite.metrics.metric.reinit__is_reduced` - :class:`~ignite.metrics.RootMeanSquaredError` - :class:`~ignite.metrics.RunningAverage` - :class:`~ignite.metrics.SSIM` - - :meth:`~ignite.metrics.metric.sync_all_reduce` - :class:`~ignite.metrics.TopKCategoricalAccuracy` - :class:`~ignite.metrics.VariableAccumulation` + - :meth:`~ignite.metrics.metric.reinit__is_reduced` + - :meth:`~ignite.metrics.metric.sync_all_reduce` .. currentmodule:: ignite.metrics @@ -323,6 +323,7 @@ Complete list of metrics .. currentmodule:: ignite.metrics.metric +.. autofunction:: reinit__is_reduced + .. autofunction:: sync_all_reduce -.. autofunction:: reinit__is_reduced From 7d2290f0707c094328fb09a3ad9f5975b36a592d Mon Sep 17 00:00:00 2001 From: Josseline Perdomo Date: Wed, 7 Oct 2020 13:51:41 -0400 Subject: [PATCH 3/4] deleted decorators from metric list --- docs/source/metrics.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst index 909418373bc6..6ed43d4fa85a 100644 --- a/docs/source/metrics.rst +++ b/docs/source/metrics.rst @@ -261,8 +261,6 @@ Complete list of metrics - :class:`~ignite.metrics.SSIM` - :class:`~ignite.metrics.TopKCategoricalAccuracy` - :class:`~ignite.metrics.VariableAccumulation` - - :meth:`~ignite.metrics.metric.reinit__is_reduced` - - :meth:`~ignite.metrics.metric.sync_all_reduce` .. currentmodule:: ignite.metrics From 144e5714c6996480c3ef4ea47fa25537d1399eb3 Mon Sep 17 00:00:00 2001 From: vfdev Date: Wed, 7 Oct 2020 22:15:58 +0200 Subject: [PATCH 4/4] Update metrics.rst --- docs/source/metrics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/metrics.rst b/docs/source/metrics.rst index 6ed43d4fa85a..53fa5bead687 100644 --- a/docs/source/metrics.rst +++ b/docs/source/metrics.rst @@ -230,7 +230,7 @@ Metrics and distributed computations ------------------------------------ In the above example, ``CustomAccuracy`` has ``reset``, ``update``, ``compute`` methods decorated -with :meth:`~ignite.metrics.metric.reinit__is_reduced`, :meth:`ignite.metrics.metric.sync_all_reduce`. The purpose of these features is to adapt metrics in distributed +with :meth:`~ignite.metrics.metric.reinit__is_reduced`, :meth:`~ignite.metrics.metric.sync_all_reduce`. The purpose of these features is to adapt metrics in distributed computations on supported backend and devices (see :doc:`distributed` for more details). 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