Skip to content

Commit

Permalink
Merge branch 'master' into lightning_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 15, 2023
2 parents f720f1e + d396cda commit f393232
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 39 deletions.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/multimodal.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion requirements/text_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/torchmetrics/classification/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
29 changes: 4 additions & 25 deletions src/torchmetrics/classification/confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f393232

Please sign in to comment.