Registry / ai-ml / pytorch-wpe

pytorch-wpe

JSON →
library0.0.1pypypiunverified

A PyTorch implementation of the Weighted Prediction Error (WPE) algorithm, primarily for speech dereverberation. It serves as a proof-of-concept, closely mirroring the WPE implementation found in `nara_wpe`. The current version is 0.0.1, released in March 2021. Due to its 'proof of concept' nature and age, it does not appear to have an active release cadence or dedicated maintenance.

pip install pytorch-wpe
INSTALL
IMPORT
SIG · PYTORCH-WPE
P
pytorch-wpe
ai-mlpythonv0.0.1
Install
3.6s avg
Import
—
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 3.6s · import 0.000s · 86MB
89MB installed
● package 89MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytorch_wpe
✓ import pytorch_wpe
✗ import pytorch_wpe

This quickstart demonstrates basic usage of key functions like `signal_framing` and `get_power` using a synthetic `ComplexTensor` as input. A real-world application would involve feeding Short-Time Fourier Transform (STFT) outputs of audio signals into these functions.

import torch from torch_complex.tensor import ComplexTensor from pytorch_wpe import signal_framing, get_power # 1. Create a dummy complex signal (e.g., from STFT output) # Shape: (batch_size, channels, time_frames) dummy_signal_real = torch.randn(1, 4, 200) dummy_signal_imag = torch.randn(1, 4, 200) dummy_complex_signal = ComplexTensor(dummy_signal_real, dummy_signal_imag) print(f"Original complex signal shape (Real, Imag): {dummy_complex_signal.real.shape}, {dummy_complex_signal.imag.shape}") # 2. Use signal_framing function frame_length = 64 # e.g., STFT window size frame_step = 32 # e.g., STFT hop length framed_signal = signal_framing(dummy_complex_signal, frame_length, frame_step) print(f"Framed signal shape: {framed_signal.shape} (batch, channels, num_frames, frame_length)") # 3. Use get_power function power = get_power(dummy_complex_signal) print(f"Power of signal shape: {power.shape} (channels, time_frames)")
Debug
Known issues
breakingAs a 'proof of concept' library at version 0.0.1 with no active development since 2021, the API is highly unstable. Future compatibility with newer PyTorch or `torch_complex` versions is not guaranteed, and breaking changes are likely without warning if external dependencies update.
fix
Pin specific versions of `torch` and `torch_complex` in your project to mitigate unforeseen breakage. Be prepared for manual code adaptation if migrating to newer environments.
affects: <=0.0.1
gotchaThe GitHub repository explicitly states that the implementation 'may be slow' as it is 'not optimized in terms of computational efficiency'. This library is not designed for high-performance, real-time applications.
fix
Benchmark performance thoroughly for your specific use case. For production or performance-critical systems, consider optimized WPE implementations like `nara_wpe` (which this library is based on) or highly optimized C++/CUDA versions.
affects: 0.0.1
gotchaLack of comprehensive documentation, examples, and community support. The library is a direct implementation of core WPE functions without high-level wrappers or extensive tutorials.
fix
Refer to the source code (`pytorch_wpe.py` in the GitHub repo) for detailed understanding of function signatures and internal logic. Knowledge of the original WPE algorithm and `nara_wpe` will be beneficial for effective use.
affects: 0.0.1
Upgrade
Version history
0.0.1latest on PyPI · released Mar 5, 2021
Audit
Dependencies
torchrequiredCore PyTorch framework dependency for tensor operations and neural network components.
torch_complexrequiredHandles complex number tensors, which are fundamental to the WPE algorithm as implemented.
numpyrequiredCommon numerical computing library often used alongside PyTorch.
Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
pytorch-wpe — pip install pytorch-wpe · libregistry