{"id":8563,"library":"pytorch-wpe","title":"PyTorch Weighted Prediction Error (WPE)","description":"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.","status":"maintenance","version":"0.0.1","language":"python","source_language":"en","source_url":"https://github.com/nttcslab-sp/dnn_wpe","tags":["pytorch","audio","speech processing","dereverberation","wpe","signal processing"],"install":[{"cmd":"pip install pytorch-wpe","lang":"bash","label":"PyPI"},{"cmd":"conda install -c conda-forge pytorch-wpe","lang":"bash","label":"Conda"}],"dependencies":[{"reason":"Core PyTorch framework dependency for tensor operations and neural network components.","package":"torch","optional":false},{"reason":"Handles complex number tensors, which are fundamental to the WPE algorithm as implemented.","package":"torch_complex","optional":false},{"reason":"Common numerical computing library often used alongside PyTorch.","package":"numpy","optional":false}],"imports":[{"wrong":"import pytorch_wpe","symbol":"pytorch_wpe","correct":"import pytorch_wpe"}],"quickstart":{"code":"import torch\nfrom torch_complex.tensor import ComplexTensor\nfrom pytorch_wpe import signal_framing, get_power\n\n# 1. Create a dummy complex signal (e.g., from STFT output)\n# Shape: (batch_size, channels, time_frames)\ndummy_signal_real = torch.randn(1, 4, 200)\ndummy_signal_imag = torch.randn(1, 4, 200)\ndummy_complex_signal = ComplexTensor(dummy_signal_real, dummy_signal_imag)\n\nprint(f\"Original complex signal shape (Real, Imag): {dummy_complex_signal.real.shape}, {dummy_complex_signal.imag.shape}\")\n\n# 2. Use signal_framing function\nframe_length = 64  # e.g., STFT window size\nframe_step = 32    # e.g., STFT hop length\nframed_signal = signal_framing(dummy_complex_signal, frame_length, frame_step)\nprint(f\"Framed signal shape: {framed_signal.shape} (batch, channels, num_frames, frame_length)\")\n\n# 3. Use get_power function\npower = get_power(dummy_complex_signal)\nprint(f\"Power of signal shape: {power.shape} (channels, time_frames)\")\n","lang":"python","description":"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."},"warnings":[{"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.","message":"As 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.","severity":"breaking","affected_versions":"<=0.0.1"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"0.0.1"},{"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.","message":"Lack of comprehensive documentation, examples, and community support. The library is a direct implementation of core WPE functions without high-level wrappers or extensive tutorials.","severity":"gotcha","affected_versions":"0.0.1"}],"env_vars":null,"search_vec":"'0.0.1':41 '2021':45 'activ':62 'age':54 'algorithm':15 'appear':58 'audio':69 'cadenc':64 'close':28 'concept':27,51 'current':38 'dedic':66 'dereverber':19,72 'due':46 'error':4,13 'found':33 'implement':8,32 'mainten':67 'march':44 'mirror':29 'nara':35 'natur':52 'predict':3,12 'primarili':16 'process':71,75 'proof':25,49 'proof-of-concept':24 'pytorch':1,7,68 'releas':42,63 'serv':21 'signal':74 'speech':18,70 'version':39 'weight':2,11 'wpe':5,14,31,36,73","created_at":"2026-04-16T17:02:50.812770+00:00","updated_at":"2026-04-16T17:02:50.812770+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmptd3hp2iw/venv/lib/python3.12/site-packages/pytorch_wpe.py\", line 4, in <module>\n    import torch\nModuleNotFoundError: No module named 'torch'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.0.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytorch-wpe/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}