torch-stoi
Computes Short Term Objective Intelligibility in PyTorch
Decision gist · record as of 2026-08-14
Yes, if you are training a PyTorch speech enhancement model and want STOI as a loss function. Install friction is low and the license is permissive. However, the dormant maintenance status (no releases for 683 days) and the documented approximation—not exact replication—of the original metric mean you should verify that the implementation's behavior matches your training requirements before committing to it in production. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction—pure Python wheel with four runtime dependencies (numpy, torch, pystoi, torchaudio).
- Dormant maintenance status (last commit 2024-09-30, no releases for 683 days) means no active bug fixes or feature work, but the narrow scope and stable API reduce risk.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2024-09-30 (683 days) · last repo commit 2024-09-30 · 107 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 427,554 downloads/mo, #6,749 on PyPI
Alternatives
Verify before relying
pip install torch_stoi
import torch
from torch_stoi import NegSTOILoss
sample_rate = 16000
loss_func = NegSTOILoss(sample_rate=sample_rate)
noisy_speech = torch.randn(2, 16000)
clean_speech = torch.randn(2, 16000)
loss = loss_func(noisy_speech, clean_speech)- Whether the PyTorch implementation's approximation error relative to the original STOI metric is acceptable for your specific training task (documentation notes results 'should be close enough' but exact quantitative bounds are not provided).
- Minimum Python version and PyTorch version compatibility (requires_python is unspecified in the fact sheet).
What it is and what it does
torch_stoi is a PyTorch implementation of the Short Term Objective Intelligibility (STOI) metric, designed specifically for use as a differentiable loss function in neural network training. It wraps the classical and extended STOI measures—metrics originally developed to predict speech intelligibility in noisy conditions—into a form that PyTorch can backpropagate through. The package depends on numpy, torch, pystoi, and torchaudio to compute the metric.
The implementation is intentionally approximate rather than exact: it trades perfect fidelity to the original STOI algorithm for computational efficiency and differentiability in a training loop. The documentation explicitly warns that it is intended only as a loss function, not as a replacement for the original metric when exact reproducibility matters. This makes it suitable for training speech enhancement or denoising models where STOI-like objectives guide the network, but not for rigorous evaluation benchmarking.
Use it for
- Train a speech denoising network using NegSTOILoss as the primary loss function to optimize for intelligibility rather than raw signal fidelity.
- Combine NegSTOILoss with other losses in a multi-objective speech enhancement model to balance intelligibility and artifact reduction.
- Validate speech enhancement models on STOI-like criteria during training without switching to a separate evaluation pipeline.
- Experiment with speech quality metrics in PyTorch workflows where torchaudio and torch are already in use.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are training a PyTorch speech enhancement model and want STOI as a loss function.
Install friction is low and the license is permissive. However, the dormant maintenance status (no releases for 683 days) and the documented approximation—not exact replication—of the original metric mean you should verify that the implementation's behavior matches your training requirements before committing to it in production. No known security vulnerabilities.
Install
torch-stoi on PyPI
Before you install
Low friction—pure Python wheel with four runtime dependencies (numpy, torch, pystoi, torchaudio). Dormant maintenance status (last commit 2024-09-30, no releases for 683 days) means no active bug fixes or feature work, but the narrow scope and stable API reduce risk.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install torch_stoi
import torch
from torch_stoi import NegSTOILoss
sample_rate = 16000
loss_func = NegSTOILoss(sample_rate=sample_rate)
noisy_speech = torch.randn(2, 16000)
clean_speech = torch.randn(2, 16000)
loss = loss_func(noisy_speech, clean_speech)
Verify before relying
- Whether the PyTorch implementation's approximation error relative to the original STOI metric is acceptable for your specific training task (documentation notes results 'should be close enough' but exact quantitative bounds are not provided).
- Minimum Python version and PyTorch version compatibility (requires_python is unspecified in the fact sheet).
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesnumpytorchpystoitorchaudio |
| Maintenance | Dormant 683 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 427,554 / month, #6,749 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 |
Evidence: torch_stoi-0.2.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “speech intelligibility loss pytorch”
- torch-stoiComputes Short Term Objective Intelligibility (STOI) as a PyTorch…
- pystoiComputes Short Term Objective Intelligibility (STOI) measures for…
- pytorch-msssimComputes fast, differentiable SSIM and MS-SSIM metrics for PyTorch…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also pystoi · torchlibrosa · torchaudio · geomloss · pytorch-metric-learning · torchfcpe · speechbrain · julius · aic-sdk · pytorch-msssim