Skip to content

Commit

Permalink
Merge branch 'master' into missing_fid_value
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Oct 6, 2023
2 parents ed08f27 + 89ca22b commit 3d43fca
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ COPY requirements/ /tmp/pip-tmp/requirements/
RUN \
pip3 install awscli && \
aws s3 sync --no-sign-request s3://sphinx-packages/ dist/ && \
# trying to resolve pesq installation issue
pip3 install -q "numpy<1.24" && \
pip3 --disable-pip-version-check --no-cache-dir install \
-r /tmp/pip-tmp/requirements/devel.txt \
-r /tmp/pip-tmp/requirements/docs.txt \
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10"]
python: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,12 +58,13 @@ jobs:
matrix:
include:
# These are the base images for PL release docker images,
# so include at least all of the combinations in release-dockers.yml.
# so include at least all of the combinations in release-dockers.yml.
- { python: "3.8", pytorch: "1.8.1", cuda: "11.1.1", ubuntu: "20.04" }
- { python: "3.9", pytorch: "1.10", cuda: "11.8.0", ubuntu: "22.04" }
- { python: "3.9", pytorch: "1.11", cuda: "11.8.0", ubuntu: "22.04" }
- { python: "3.9", pytorch: "1.13", cuda: "11.8.0", ubuntu: "22.04" }
- { python: "3.10", pytorch: "2.0", cuda: "11.8.0", ubuntu: "22.04" }
- { python: "3.11", pytorch: "2.0", cuda: "12.1.0", ubuntu: "22.04" }
steps:
- uses: actions/checkout@v4

Expand All @@ -74,7 +75,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build (and Push) Devcontainer
- name: Build (and Push) runner
uses: docker/build-push-action@v5
with:
build-args: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed numerical stability bug in `LearnedPerceptualImagePatchSimilarity` metric ([#2144](https://github.com/Lightning-AI/torchmetrics/pull/2144))


## [1.2.0] - 2023-09-22
Expand Down
2 changes: 0 additions & 2 deletions dockers/ubuntu-cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ RUN \
done && \
# trying to resolve pesq installation issue
pip install -q "numpy<1.24" && \
# needed for the gpu multiprocessing
pip install "mkl-service==2.4.0" && \
CUDA_VERSION_MM=${CUDA_VERSION%.*} && \
CU_VERSION_MM=${CUDA_VERSION_MM//'.'/''} && \
pip install --no-cache-dir -r requirements/devel.txt \
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ def _get_version_str():
# skip false positive linkcheck errors from anchors
linkcheck_anchors = False

# A timeout value, in seconds, for the linkcheck builder.
linkcheck_timeout = 10

# ignore all links in any CHANGELOG file
linkcheck_exclude_documents = [r"^(.*\/)*CHANGELOG.*$"]

Expand Down
14 changes: 7 additions & 7 deletions docs/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
.. _Mean-Average-Precision (mAP) and Mean-Average-Recall (mAR): https://jonathan-hui.medium.com/map-mean-average-precision-for-object-detection-45c121a31173
.. _Tweedie Deviance Score: https://en.wikipedia.org/wiki/Tweedie_distribution#The_Tweedie_deviance
.. _Permutation Invariant Training of Deep Models: https://ieeexplore.ieee.org/abstract/document/7952154
.. _Top-label Calibration Error: https://arxiv.org/pdf/1909.10155.pdf
.. _Top-label Calibration Error: https://arxiv.org/abs/1909.10155
.. _Gradient Computation of Image: https://en.wikipedia.org/wiki/Image_gradient
.. _R2 Score_Coefficient Determination: https://en.wikipedia.org/wiki/Coefficient_of_determination
.. _Rank of element tensor: https://github.com/scipy/scipy/blob/v1.6.2/scipy/stats/stats.py#L4140-L4303
Expand Down Expand Up @@ -76,7 +76,7 @@
.. _Python ROUGE Implementation: https://pypi.org/project/rouge-score/
.. _Scikit_Learn-Ranking.py: https: //github.com/scikit-learn/scikit-learn/blob/master/sklearn/metrics/_ranking.py
.. _Verified Uncertainty Calibration: https://arxiv.org/abs/1909.10155
.. _SQuAD Metric: https://arxiv.org/pdf/1606.05250.pdf
.. _SQuAD Metric: https://arxiv.org/abs/1606.05250
.. _chrF score: https://aclanthology.org/W15-3049.pdf
.. _chrF++ score: https://aclanthology.org/W17-4770.pdf
.. _TER: https://aclanthology.org/2006.amta-papers.25.pdf
Expand All @@ -91,19 +91,19 @@
.. _WIL: https://www.isca-speech.org/archive/interspeech_2004/morris04_interspeech.html
.. _WIP: https://infoscience.epfl.ch/record/82766
.. _TV: https://en.wikipedia.org/wiki/Total_variation_denoising
.. _InfoLM: https://arxiv.org/pdf/2112.01589.pdf
.. _InfoLM: https://arxiv.org/abs/2112.01589
.. _alpha divergence: https://static.renyi.hu/renyi_cikkek/1961_on_measures_of_entropy_and_information.pdf
.. _beta divergence: https://www.sciencedirect.com/science/article/pii/S0047259X08000456
.. _AB divergence: https://pdfs.semanticscholar.org/744b/1166de34cb099100f151f3b1459f141ae25b.pdf
.. _Rényi divergence: https://static.renyi.hu/renyi_cikkek/1961_on_measures_of_entropy_and_information.pdf
.. _Fisher-Rao distance: https://arxiv.org/pdf/1711.01530.pdf
.. _Fisher-Rao distance: https://arxiv.org/abs/1711.01530
.. _Cramer's V: https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_V
.. _Kendall Rank Correlation Coefficient: https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient
.. _The Treatment of Ties in Ranking Problems: https://www.jstor.org/stable/2332303
.. _LogCosh Error: https://arxiv.org/pdf/2101.10427.pdf
.. _LogCosh Error: https://arxiv.org/abs/2101.10427
.. _Tschuprow's T: https://en.wikipedia.org/wiki/Tschuprow%27s_T
.. _Pearson's Contingency Coefficient: https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/pearcont.htm
.. _CLIP score: https://arxiv.org/pdf/2104.08718.pdf
.. _CLIP score: https://arxiv.org/abs/2104.08718
.. _Huggingface OpenAI: https://huggingface.co/openai
.. _Theils Uncertainty coefficient: https://en.wikipedia.org/wiki/Uncertainty_coefficient
.. _Perceptual Evaluation of Speech Quality: https://en.wikipedia.org/wiki/Perceptual_Evaluation_of_Speech_Quality
Expand Down Expand Up @@ -146,7 +146,7 @@
.. _VIF: https://ieeexplore.ieee.org/abstract/document/1576816
.. _CLIP-IQA: https://arxiv.org/abs/2207.12396
.. _CLIP: https://arxiv.org/abs/2103.00020
.. _PPL : https://arxiv.org/pdf/1812.04948
.. _PPL : https://arxiv.org/abs/1812.04948
.. _CIOU: https://arxiv.org/abs/2005.03572
.. _DIOU: https://arxiv.org/abs/1911.08287v1
.. _GIOU: https://arxiv.org/abs/1902.09630
Expand Down
3 changes: 2 additions & 1 deletion requirements/typing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mypy==1.5.1
mypy ==1.5.1
torch ==2.0.0

types-PyYAML
types-emoji
Expand Down
8 changes: 4 additions & 4 deletions src/torchmetrics/functional/image/lpips.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ def _upsample(in_tens: Tensor, out_hw: Tuple[int, ...] = (64, 64)) -> Tensor:
return nn.Upsample(size=out_hw, mode="bilinear", align_corners=False)(in_tens)


def _normalize_tensor(in_feat: Tensor, eps: float = 1e-10) -> Tensor:
"""Normalize tensors."""
norm_factor = torch.sqrt(torch.sum(in_feat**2, dim=1, keepdim=True))
return in_feat / (norm_factor + eps)
def _normalize_tensor(in_feat: Tensor, eps: float = 1e-8) -> Tensor:
"""Normalize input tensor."""
norm_factor = torch.sqrt(eps + torch.sum(in_feat**2, dim=1, keepdim=True))
return in_feat / norm_factor


def _resize_tensor(x: Tensor, size: int = 64) -> Tensor:
Expand Down

0 comments on commit 3d43fca

Please sign in to comment.