We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove `activation` argument from AveragePrecision and ROC_AUC
I propose to remove `activation` argument from `AveragePrecision` and `ROC_AUC`:
https://github.com/pytorch/ignite/blob/862ab0073e461a32bf5b53fa015f88c143ae9079/ignite/contrib/metrics/roc_auc.py#L23-L28
to be coherent with `Accuracy` et friends and the usage of `output_transform` to apply the binarization/activation :
https://github.com/pytorch/ignite/blob/862ab0073e461a32bf5b53fa015f88c143ae9079/ignite/metrics/accuracy.py#L81-L93



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ignite/contrib/metrics/roc_auc.py`
Content:
```
1 from functools import partial
2 from ignite.metrics import EpochMetric
3 
4 
5 def roc_auc_compute_fn(y_preds, y_targets, activation=None):
6     try:
7         from sklearn.metrics import roc_auc_score
8     except ImportError:
9         raise RuntimeError("This contrib module requires sklearn to be installed.")
10 
11     y_true = y_targets.numpy()
12     if activation is not None:
13         y_preds = activation(y_preds)
14     y_pred = y_preds.numpy()
15     return roc_auc_score(y_true, y_pred)
16 
17 
18 class ROC_AUC(EpochMetric):
19     """Computes Area Under the Receiver Operating Characteristic Curve (ROC AUC)
20     accumulating predictions and the ground-truth during an epoch and applying
21     `sklearn.metrics.roc_auc_score <http://scikit-learn.org/stable/modules/generated/
22     sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score>`_ .
23 
24     Args:
25         activation (callable, optional): optional function to apply on prediction tensors,
26             e.g. `activation=torch.sigmoid` to transform logits.
27         output_transform (callable, optional): a callable that is used to transform the
28             :class:`~ignite.engine.Engine`'s `process_function`'s output into the
29             form expected by the metric. This can be useful if, for example, you have a multi-output model and
30             you want to compute the metric with respect to one of the outputs.
31 
32     """
33     def __init__(self, activation=None, output_transform=lambda x: x):
34         super(ROC_AUC, self).__init__(partial(roc_auc_compute_fn, activation=activation),
35                                       output_transform=output_transform)
36
```

Path: `ignite/contrib/metrics/average_precision.py`
Content:
```
1 from functools import partial
2 from ignite.metrics import EpochMetric
3 
4 
5 def average_precision_compute_fn(y_preds, y_targets, activation=None):
6     try:
7         from sklearn.metrics import average_precision_score
8     except ImportError:
9         raise RuntimeError("This contrib module requires sklearn to be installed.")
10 
11     y_true = y_targets.numpy()
12     if activation is not None:
13         y_preds = activation(y_preds)
14     y_pred = y_preds.numpy()
15     return average_precision_score(y_true, y_pred)
16 
17 
18 class AveragePrecision(EpochMetric):
19     """Computes Average Precision accumulating predictions and the ground-truth during an epoch
20     and applying `sklearn.metrics.average_precision_score <http://scikit-learn.org/stable/modules/generated/
21     sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score>`_ .
22 
23     Args:
24         activation (callable, optional): optional function to apply on prediction tensors,
25             e.g. `activation=torch.sigmoid` to transform logits.
26         output_transform (callable, optional): a callable that is used to transform the
27             :class:`~ignite.engine.Engine`'s `process_function`'s output into the
28             form expected by the metric. This can be useful if, for example, you have a multi-output model and
29             you want to compute the metric with respect to one of the outputs.
30 
31     """
32     def __init__(self, activation=None, output_transform=lambda x: x):
33         super(AveragePrecision, self).__init__(partial(average_precision_compute_fn, activation=activation),
34                                                output_transform=output_transform)
35
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ignite/contrib/metrics/average_precision.py b/ignite/contrib/metrics/average_precision.py
--- a/ignite/contrib/metrics/average_precision.py
+++ b/ignite/contrib/metrics/average_precision.py
@@ -1,16 +1,13 @@
-from functools import partial
 from ignite.metrics import EpochMetric
 
 
-def average_precision_compute_fn(y_preds, y_targets, activation=None):
+def average_precision_compute_fn(y_preds, y_targets):
     try:
         from sklearn.metrics import average_precision_score
     except ImportError:
         raise RuntimeError("This contrib module requires sklearn to be installed.")
 
     y_true = y_targets.numpy()
-    if activation is not None:
-        y_preds = activation(y_preds)
     y_pred = y_preds.numpy()
     return average_precision_score(y_true, y_pred)
 
@@ -21,14 +18,23 @@
     sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score>`_ .
 
     Args:
-        activation (callable, optional): optional function to apply on prediction tensors,
-            e.g. `activation=torch.sigmoid` to transform logits.
         output_transform (callable, optional): a callable that is used to transform the
             :class:`~ignite.engine.Engine`'s `process_function`'s output into the
             form expected by the metric. This can be useful if, for example, you have a multi-output model and
             you want to compute the metric with respect to one of the outputs.
 
+    AveragePrecision expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or
+    confidence values. To apply an activation to y_pred, use output_transform as shown below:
+
+    .. code-block:: python
+
+        def activated_output_transform(output):
+            y_pred, y = output
+            y_pred = torch.softmax(y_pred)
+            return y_pred, y
+
+        avg_precision = AveragePrecision(activated_output_transform)
+
     """
     def __init__(self, activation=None, output_transform=lambda x: x):
-        super(AveragePrecision, self).__init__(partial(average_precision_compute_fn, activation=activation),
-                                               output_transform=output_transform)
+        super(AveragePrecision, self).__init__(average_precision_compute_fn, output_transform=output_transform)
diff --git a/ignite/contrib/metrics/roc_auc.py b/ignite/contrib/metrics/roc_auc.py
--- a/ignite/contrib/metrics/roc_auc.py
+++ b/ignite/contrib/metrics/roc_auc.py
@@ -1,16 +1,13 @@
-from functools import partial
 from ignite.metrics import EpochMetric
 
 
-def roc_auc_compute_fn(y_preds, y_targets, activation=None):
+def roc_auc_compute_fn(y_preds, y_targets):
     try:
         from sklearn.metrics import roc_auc_score
     except ImportError:
         raise RuntimeError("This contrib module requires sklearn to be installed.")
 
     y_true = y_targets.numpy()
-    if activation is not None:
-        y_preds = activation(y_preds)
     y_pred = y_preds.numpy()
     return roc_auc_score(y_true, y_pred)
 
@@ -22,14 +19,23 @@
     sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score>`_ .
 
     Args:
-        activation (callable, optional): optional function to apply on prediction tensors,
-            e.g. `activation=torch.sigmoid` to transform logits.
         output_transform (callable, optional): a callable that is used to transform the
             :class:`~ignite.engine.Engine`'s `process_function`'s output into the
             form expected by the metric. This can be useful if, for example, you have a multi-output model and
             you want to compute the metric with respect to one of the outputs.
 
+    ROC_AUC expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or confidence
+    values. To apply an activation to y_pred, use output_transform as shown below:
+
+    .. code-block:: python
+
+        def activated_output_transform(output):
+            y_pred, y = output
+            y_pred = torch.sigmoid(y_pred)
+            return y_pred, y
+
+        roc_auc = ROC_AUC(activated_output_transform)
+
     """
-    def __init__(self, activation=None, output_transform=lambda x: x):
-        super(ROC_AUC, self).__init__(partial(roc_auc_compute_fn, activation=activation),
-                                      output_transform=output_transform)
+    def __init__(self, output_transform=lambda x: x):
+        super(ROC_AUC, self).__init__(roc_auc_compute_fn, output_transform=output_transform)

{"golden_diff": "diff --git a/ignite/contrib/metrics/average_precision.py b/ignite/contrib/metrics/average_precision.py\n--- a/ignite/contrib/metrics/average_precision.py\n+++ b/ignite/contrib/metrics/average_precision.py\n@@ -1,16 +1,13 @@\n-from functools import partial\n from ignite.metrics import EpochMetric\n \n \n-def average_precision_compute_fn(y_preds, y_targets, activation=None):\n+def average_precision_compute_fn(y_preds, y_targets):\n     try:\n         from sklearn.metrics import average_precision_score\n     except ImportError:\n         raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n \n     y_true = y_targets.numpy()\n-    if activation is not None:\n-        y_preds = activation(y_preds)\n     y_pred = y_preds.numpy()\n     return average_precision_score(y_true, y_pred)\n \n@@ -21,14 +18,23 @@\n     sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score>`_ .\n \n     Args:\n-        activation (callable, optional): optional function to apply on prediction tensors,\n-            e.g. `activation=torch.sigmoid` to transform logits.\n         output_transform (callable, optional): a callable that is used to transform the\n             :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n             form expected by the metric. This can be useful if, for example, you have a multi-output model and\n             you want to compute the metric with respect to one of the outputs.\n \n+    AveragePrecision expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or\n+    confidence values. To apply an activation to y_pred, use output_transform as shown below:\n+\n+    .. code-block:: python\n+\n+        def activated_output_transform(output):\n+            y_pred, y = output\n+            y_pred = torch.softmax(y_pred)\n+            return y_pred, y\n+\n+        avg_precision = AveragePrecision(activated_output_transform)\n+\n     \"\"\"\n     def __init__(self, activation=None, output_transform=lambda x: x):\n-        super(AveragePrecision, self).__init__(partial(average_precision_compute_fn, activation=activation),\n-                                               output_transform=output_transform)\n+        super(AveragePrecision, self).__init__(average_precision_compute_fn, output_transform=output_transform)\ndiff --git a/ignite/contrib/metrics/roc_auc.py b/ignite/contrib/metrics/roc_auc.py\n--- a/ignite/contrib/metrics/roc_auc.py\n+++ b/ignite/contrib/metrics/roc_auc.py\n@@ -1,16 +1,13 @@\n-from functools import partial\n from ignite.metrics import EpochMetric\n \n \n-def roc_auc_compute_fn(y_preds, y_targets, activation=None):\n+def roc_auc_compute_fn(y_preds, y_targets):\n     try:\n         from sklearn.metrics import roc_auc_score\n     except ImportError:\n         raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n \n     y_true = y_targets.numpy()\n-    if activation is not None:\n-        y_preds = activation(y_preds)\n     y_pred = y_preds.numpy()\n     return roc_auc_score(y_true, y_pred)\n \n@@ -22,14 +19,23 @@\n     sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score>`_ .\n \n     Args:\n-        activation (callable, optional): optional function to apply on prediction tensors,\n-            e.g. `activation=torch.sigmoid` to transform logits.\n         output_transform (callable, optional): a callable that is used to transform the\n             :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n             form expected by the metric. This can be useful if, for example, you have a multi-output model and\n             you want to compute the metric with respect to one of the outputs.\n \n+    ROC_AUC expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or confidence\n+    values. To apply an activation to y_pred, use output_transform as shown below:\n+\n+    .. code-block:: python\n+\n+        def activated_output_transform(output):\n+            y_pred, y = output\n+            y_pred = torch.sigmoid(y_pred)\n+            return y_pred, y\n+\n+        roc_auc = ROC_AUC(activated_output_transform)\n+\n     \"\"\"\n-    def __init__(self, activation=None, output_transform=lambda x: x):\n-        super(ROC_AUC, self).__init__(partial(roc_auc_compute_fn, activation=activation),\n-                                      output_transform=output_transform)\n+    def __init__(self, output_transform=lambda x: x):\n+        super(ROC_AUC, self).__init__(roc_auc_compute_fn, output_transform=output_transform)\n", "issue": "Remove `activation` argument from AveragePrecision and ROC_AUC\nI propose to remove `activation` argument from `AveragePrecision` and `ROC_AUC`:\r\nhttps://github.com/pytorch/ignite/blob/862ab0073e461a32bf5b53fa015f88c143ae9079/ignite/contrib/metrics/roc_auc.py#L23-L28\r\nto be coherent with `Accuracy` et friends and the usage of `output_transform` to apply the binarization/activation :\r\nhttps://github.com/pytorch/ignite/blob/862ab0073e461a32bf5b53fa015f88c143ae9079/ignite/metrics/accuracy.py#L81-L93\r\n\r\n\n", "before_files": [{"content": "from functools import partial\nfrom ignite.metrics import EpochMetric\n\n\ndef roc_auc_compute_fn(y_preds, y_targets, activation=None):\n    try:\n        from sklearn.metrics import roc_auc_score\n    except ImportError:\n        raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n\n    y_true = y_targets.numpy()\n    if activation is not None:\n        y_preds = activation(y_preds)\n    y_pred = y_preds.numpy()\n    return roc_auc_score(y_true, y_pred)\n\n\nclass ROC_AUC(EpochMetric):\n    \"\"\"Computes Area Under the Receiver Operating Characteristic Curve (ROC AUC)\n    accumulating predictions and the ground-truth during an epoch and applying\n    `sklearn.metrics.roc_auc_score <http://scikit-learn.org/stable/modules/generated/\n    sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score>`_ .\n\n    Args:\n        activation (callable, optional): optional function to apply on prediction tensors,\n            e.g. `activation=torch.sigmoid` to transform logits.\n        output_transform (callable, optional): a callable that is used to transform the\n            :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n            form expected by the metric. This can be useful if, for example, you have a multi-output model and\n            you want to compute the metric with respect to one of the outputs.\n\n    \"\"\"\n    def __init__(self, activation=None, output_transform=lambda x: x):\n        super(ROC_AUC, self).__init__(partial(roc_auc_compute_fn, activation=activation),\n                                      output_transform=output_transform)\n", "path": "ignite/contrib/metrics/roc_auc.py"}, {"content": "from functools import partial\nfrom ignite.metrics import EpochMetric\n\n\ndef average_precision_compute_fn(y_preds, y_targets, activation=None):\n    try:\n        from sklearn.metrics import average_precision_score\n    except ImportError:\n        raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n\n    y_true = y_targets.numpy()\n    if activation is not None:\n        y_preds = activation(y_preds)\n    y_pred = y_preds.numpy()\n    return average_precision_score(y_true, y_pred)\n\n\nclass AveragePrecision(EpochMetric):\n    \"\"\"Computes Average Precision accumulating predictions and the ground-truth during an epoch\n    and applying `sklearn.metrics.average_precision_score <http://scikit-learn.org/stable/modules/generated/\n    sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score>`_ .\n\n    Args:\n        activation (callable, optional): optional function to apply on prediction tensors,\n            e.g. `activation=torch.sigmoid` to transform logits.\n        output_transform (callable, optional): a callable that is used to transform the\n            :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n            form expected by the metric. This can be useful if, for example, you have a multi-output model and\n            you want to compute the metric with respect to one of the outputs.\n\n    \"\"\"\n    def __init__(self, activation=None, output_transform=lambda x: x):\n        super(AveragePrecision, self).__init__(partial(average_precision_compute_fn, activation=activation),\n                                               output_transform=output_transform)\n", "path": "ignite/contrib/metrics/average_precision.py"}], "after_files": [{"content": "from ignite.metrics import EpochMetric\n\n\ndef roc_auc_compute_fn(y_preds, y_targets):\n    try:\n        from sklearn.metrics import roc_auc_score\n    except ImportError:\n        raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n\n    y_true = y_targets.numpy()\n    y_pred = y_preds.numpy()\n    return roc_auc_score(y_true, y_pred)\n\n\nclass ROC_AUC(EpochMetric):\n    \"\"\"Computes Area Under the Receiver Operating Characteristic Curve (ROC AUC)\n    accumulating predictions and the ground-truth during an epoch and applying\n    `sklearn.metrics.roc_auc_score <http://scikit-learn.org/stable/modules/generated/\n    sklearn.metrics.roc_auc_score.html#sklearn.metrics.roc_auc_score>`_ .\n\n    Args:\n        output_transform (callable, optional): a callable that is used to transform the\n            :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n            form expected by the metric. This can be useful if, for example, you have a multi-output model and\n            you want to compute the metric with respect to one of the outputs.\n\n    ROC_AUC expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or confidence\n    values. To apply an activation to y_pred, use output_transform as shown below:\n\n    .. code-block:: python\n\n        def activated_output_transform(output):\n            y_pred, y = output\n            y_pred = torch.sigmoid(y_pred)\n            return y_pred, y\n\n        roc_auc = ROC_AUC(activated_output_transform)\n\n    \"\"\"\n    def __init__(self, output_transform=lambda x: x):\n        super(ROC_AUC, self).__init__(roc_auc_compute_fn, output_transform=output_transform)\n", "path": "ignite/contrib/metrics/roc_auc.py"}, {"content": "from ignite.metrics import EpochMetric\n\n\ndef average_precision_compute_fn(y_preds, y_targets):\n    try:\n        from sklearn.metrics import average_precision_score\n    except ImportError:\n        raise RuntimeError(\"This contrib module requires sklearn to be installed.\")\n\n    y_true = y_targets.numpy()\n    y_pred = y_preds.numpy()\n    return average_precision_score(y_true, y_pred)\n\n\nclass AveragePrecision(EpochMetric):\n    \"\"\"Computes Average Precision accumulating predictions and the ground-truth during an epoch\n    and applying `sklearn.metrics.average_precision_score <http://scikit-learn.org/stable/modules/generated/\n    sklearn.metrics.average_precision_score.html#sklearn.metrics.average_precision_score>`_ .\n\n    Args:\n        output_transform (callable, optional): a callable that is used to transform the\n            :class:`~ignite.engine.Engine`'s `process_function`'s output into the\n            form expected by the metric. This can be useful if, for example, you have a multi-output model and\n            you want to compute the metric with respect to one of the outputs.\n\n    AveragePrecision expects y to be comprised of 0's and 1's. y_pred must either be probability estimates or\n    confidence values. To apply an activation to y_pred, use output_transform as shown below:\n\n    .. code-block:: python\n\n        def activated_output_transform(output):\n            y_pred, y = output\n            y_pred = torch.softmax(y_pred)\n            return y_pred, y\n\n        avg_precision = AveragePrecision(activated_output_transform)\n\n    \"\"\"\n    def __init__(self, activation=None, output_transform=lambda x: x):\n        super(AveragePrecision, self).__init__(average_precision_compute_fn, output_transform=output_transform)\n", "path": "ignite/contrib/metrics/average_precision.py"}]}