Skip to main content

Bring lowpass filtering to PyTorch!

Project description

torch_lfilter

Bring low pass filtering to PyTorch!

This pytorch extension offers a PyTorch alternative for Scipy's lfilter - with gradient tracking.

CPU tensors only (efficiently...)

Although it's certainly the goal to implement an efficient CUDA lfilter in C++, for now only the CPU version is implemented in C++. That said, the implementation is reasonably fast and doing the filtering on the CPU might be a viable option. Moreover, the pure-python implementation works on all devices.

Installation

The library can be installed with pip:

pip install torch_lfilter

Please note that no pre-built wheels exist. This means that pip will attempt to install the library from source. Make sure you have the necessary dependencies installed for your OS.

Dependencies

Linux

On Linux, having PyTorch installed is often enough to be able install the library (along with the typical developer tools for your distribution). Run the following inside a conda environment:

conda install pytorch -c pytorch
pip install torch_lfilter

Windows

On Windows, the installation process is a bit more involved as typically the build dependencies are not installed. To install those, download Visual Studio Community 2017 from here. During installation, go to Workloads and select the following workloads:

  • Desktop development with C++
  • Python development

Then go to Individual Components and select the following additional items:

  • C++/CLI support
  • VC++ 2015.3 v14.00 (v140) toolset for desktop

After installation, run the following commands inside a x64 Native Tools Command Prompt for VS 2017, after activating your conda environment:

conda install pytorch -c pytorch
pip install torch_lfilter

License

© Floris Laporte 2020, GPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_lfilter-0.0.3.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file torch_lfilter-0.0.3.tar.gz.

File metadata

  • Download URL: torch_lfilter-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200616 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6

File hashes

Hashes for torch_lfilter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 aa613725b73e7b6e7efd63c30580a906d7bb23206b5d045b8452ab770f7a50df
MD5 d3330be37aa719b0a28dc9362cc1356d
BLAKE2b-256 4580872c4624dcca771e6773e79c476dfe42c456cf63eef6fae3d9a76cd06870

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page