diff --git a/docs/source/conf.py b/docs/source/conf.py index 1fa459d3692..3c6517bdf2e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -79,7 +79,7 @@ def _transform_changelog(path_in: str, path_out: str) -> None: # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0" +needs_sphinx = "6.2" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -138,7 +138,7 @@ def _transform_changelog(path_in: str, path_out: str) -> None: # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/requirements/docs.txt b/requirements/docs.txt index 84997775b65..9cd8e354874 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,17 +1,17 @@ -sphinx>=4.0, <5.0 +sphinx >6.0, <7.0 myst-parser -nbsphinx>=0.8 -pandoc>=1.0 -docutils>=0.16 -sphinxcontrib-fulltoc>=1.0 +nbsphinx >=0.8 +pandoc >=1.0 +docutils >=0.16 +sphinxcontrib-fulltoc >=1.0 sphinxcontrib-mockautodoc https://github.com/Lightning-AI/lightning_sphinx_theme/archive/master.zip#egg=pt-lightning-sphinx-theme -sphinx-autodoc-typehints>=1.0 -sphinx-paramlinks>=0.5.1 -sphinx-togglebutton>=0.2 -sphinx-copybutton>=0.3 +sphinx-autodoc-typehints >=1.0 +sphinx-paramlinks >=0.5.1 +sphinx-togglebutton >=0.2 +sphinx-copybutton >=0.3 -lightning>=1.8.0, <3.0.0 +lightning >=1.8.0, <3.0.0 # integrations -r integrate.txt diff --git a/requirements/multimodal.txt b/requirements/multimodal.txt index 13c53764463..18a9036a134 100644 --- a/requirements/multimodal.txt +++ b/requirements/multimodal.txt @@ -1,4 +1,4 @@ # NOTE: the upper bound for the package version is only set for CI stability, and it is dropped while installing this package # in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment -transformers >=4.10.0, <4.29.3 +transformers >=4.10.0, <4.30.2 diff --git a/requirements/text_test.txt b/requirements/text_test.txt index 0d478132fa2..6bfbeaaed6e 100644 --- a/requirements/text_test.txt +++ b/requirements/text_test.txt @@ -4,6 +4,6 @@ jiwer >=2.3.0, <=3.0.1 rouge-score >0.1.0, <=0.1.2 bert_score ==0.3.13 -transformers >4.4.0, <4.29.3 +transformers >4.4.0, <4.30.2 huggingface-hub <0.16 # hotfix, failing SDR for latest PT 1.11 sacrebleu >=2.0.0, <=2.3.1 diff --git a/src/torchmetrics/classification/accuracy.py b/src/torchmetrics/classification/accuracy.py index b192c56493a..e04edd7c241 100644 --- a/src/torchmetrics/classification/accuracy.py +++ b/src/torchmetrics/classification/accuracy.py @@ -48,6 +48,8 @@ class BinaryAccuracy(BinaryStatScores): If ``multidim_average`` is set to ``samplewise``, the metric returns ``(N,)`` vector consisting of a scalar value per sample. + Additional dimension ``...`` will be flattened into the batch dimension. + Args: threshold: Threshold for transforming probability to binary {0,1} predictions multidim_average: diff --git a/src/torchmetrics/classification/confusion_matrix.py b/src/torchmetrics/classification/confusion_matrix.py index 5f1ea5dca4c..8858880e037 100644 --- a/src/torchmetrics/classification/confusion_matrix.py +++ b/src/torchmetrics/classification/confusion_matrix.py @@ -57,12 +57,11 @@ class BinaryConfusionMatrix(Metric): element. Addtionally, we convert to int tensor with thresholding using the value in ``threshold``. - ``target`` (:class:`~torch.Tensor`): An int tensor of shape ``(N, ...)``. - .. note:: - Additional dimension ``...`` will be flattened into the batch dimension. - As output to ``forward`` and ``compute`` the metric returns the following output: - - ``bcm`` (:class:`~torch.Tensor`): A tensor containing a ``(2, 2)`` matrix + - ``confusion_matrix`` (:class:`~torch.Tensor`): A tensor containing a ``(2, 2)`` matrix + + Additional dimension ``...`` will be flattened into the batch dimension. Args: threshold: Threshold for transforming probability to binary (0,1) predictions @@ -179,27 +178,9 @@ class MulticlassConfusionMatrix(Metric): element. Addtionally, we convert to int tensor with thresholding using the value in ``threshold``. - ``target`` (:class:`~torch.Tensor`): An int tensor of shape ``(N, ...)``. - .. note:: - Additional dimension ``...`` will be flattened into the batch dimension. - As output to ``forward`` and ``compute`` the metric returns the following output: - - ``bcm`` (:class:`~torch.Tensor`): A tensor containing a ``(2, 2)`` matrix - - --- - - As input to 'update' the metric accepts the following input: - - - ``preds``: ``(N, ...)`` (int tensor) or ``(N, C, ..)`` (float tensor). If preds is a floating point - we apply ``torch.argmax`` along the ``C`` dimension to automatically convert probabilities/logits into - an int tensor. - - ``target`` (int tensor): ``(N, ...)`` - - Additional dimension ``...`` will be flattened into the batch dimension. - - As output of 'compute' the metric returns the following output: - - - ``confusion matrix``: [num_classes, num_classes] matrix + - ``confusion_matrix``: [num_classes, num_classes] matrix Args: num_classes: Integer specifing the number of classes @@ -322,8 +303,6 @@ class MultilabelConfusionMatrix(Metric): we convert to int tensor with thresholding using the value in ``threshold``. - ``target`` (int tensor): ``(N, C, ...)`` - Additional dimension ``...`` will be flattened into the batch dimension. - As output of 'compute' the metric returns the following output: - ``confusion matrix``: [num_labels,2,2] matrix