# Multiscalestructuralsimilarityindexmeasure

> Compute the MultiScaleStructuralSimilarityIndexMeasure metric — provided by torchmetrics. Use when the user has predictions and ground-truth and needs to compute MultiScaleStructuralSimilarityIndexMeasure, or asks how to score with MultiScaleStructuralSimilarityIndexMeasure.

- Skill: `qhjqhj00/multiscalestructuralsimilarityindexmeasure` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/multiscalestructuralsimilarityindexmeasure`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/multiscalestructuralsimilarityindexmeasure/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/multiscalestructuralsimilarityindexmeasure

---


# multiscalestructuralsimilarityindexmeasure

> Metric `MultiScaleStructuralSimilarityIndexMeasure` from `torchmetrics` (torchmetrics.MultiScaleStructuralSimilarityIndexMeasure)

## When to invoke this skill

The user has predictions + ground truth and asks to evaluate with MultiScaleStructuralSimilarityIndexMeasure, or
mentions `torchmetrics.MultiScaleStructuralSimilarityIndexMeasure` directly, or wants the standard torchmetrics implementation.

## Reference signature

```python
from torchmetrics import MultiScaleStructuralSimilarityIndexMeasure

# _MultiScaleStructuralSimilarityIndexMeasure(gaussian_kernel: bool = True, kernel_size: Union[int, collections.abc.Sequence[int]] = 11, sigma: Union[float, collections.abc.Sequence[float]] = 1.5, reduction: Literal['elementwise_mean', 'sum', 'none', None] = 'elementwise_mean', data_range: Union[float, tuple[float, float], NoneType] = None, k1: float = 0.01, k2: float = 0.03, betas: tuple[float, ...] = (0.0448, 0.2856, 0.3001, 0.2363, 0.1333), normalize: Literal['relu', 'simple', None] = 'relu', **kwargs: Any) -> None
```

## Library docstring

```
Wrapper for deprecated import.

>>> from torch import rand
>>> preds = rand([3, 3, 256, 256])
>>> target = preds * 0.75
>>> ms_ssim = _MultiScaleStructuralSimilarityIndexMeasure(data_range=1.0)
>>> ms_ssim(preds, target)
tensor(0.9628)
```

## Quick recipe

```python
import torchmetrics as _m
score = _m.MultiScaleStructuralSimilarityIndexMeasure(y_true, y_pred)
```

## Don'ts

- Don't reimplement when the library version handles edge cases (NaN, ties, empty inputs) better than a hand-rolled formula.
- Always check the library version's argument order — sklearn is `(y_true, y_pred)` while torchmetrics is `(preds, target)`.

