https://github.com/aliutkus/torchinterp1d

1D interpolation for pytorch

https://github.com/aliutkus/torchinterp1d

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.0%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

1D interpolation for pytorch

Basic Info
  • Host: GitHub
  • Owner: aliutkus
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Size: 39.1 KB
Statistics
  • Stars: 172
  • Watchers: 3
  • Forks: 23
  • Open Issues: 18
  • Releases: 1
Created almost 8 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

torchinterp1d

CUDA 1-D interpolation for Pytorch

Requires PyTorch >= 1.6 (due to torch.searchsorted).

Presentation

This repository implements an interp1d function that overrides torch.autograd.Function, enabling linear 1D interpolation on the GPU for Pytorch.

def interp1d(x, y, xnew, out=None)

This function returns interpolated values of a set of 1-D functions at the desired query points xnew.

It works similarly to Matlab™ or scipy functions with the linear interpolation mode on, except that it parallelises over any number of desired interpolation problems and exploits CUDA on the GPU

Parameters for interp1d

  • x : a (N, ) or (D, N) Pytorch Tensor: Either 1-D or 2-D. It contains the coordinates of the observed samples.

  • y : (N,) or (D, N) Pytorch Tensor. Either 1-D or 2-D. It contains the actual values that correspond to the coordinates given by x. The length of y along its last dimension must be the same as that of x

  • xnew : (P,) or (D, P) Pytorch Tensor. Either 1-D or 2-D. If it is not 1-D, its length along the first dimension must be the same as that of whichever x and y is 2-D. x-coordinates for which we want the interpolated output.

  • out : (D, P) Pytorch Tensor` Tensor for the output. If None: allocated automatically.

Results

a Pytorch tensor of shape (D, P), containing the interpolated values.

Installation

Type pip install -e . in the root folder of this repo.

Usage

Basically simply calle torchinterp1d.interp1d.

Try out python test.py in the examples folder. Solving 100000 interpolation problems: each with 100 observations and 30 desired values CPU: 8060.260ms, GPU: 70.735ms, error: 0.000000%.

Owner

  • Name: Antoine Liutkus
  • Login: aliutkus
  • Kind: user
  • Location: France
  • Company: @INRIA

Researcher at Inria

GitHub Events

Total
  • Watch event: 5
  • Issue comment event: 1
  • Pull request event: 1
  • Fork event: 4
Last Year
  • Watch event: 5
  • Issue comment event: 1
  • Pull request event: 1
  • Fork event: 4

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 39
  • Total Committers: 4
  • Avg Commits per committer: 9.75
  • Development Distribution Score (DDS): 0.128
Past Year
  • Commits: 4
  • Committers: 2
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.25
Top Committers
Name Email Commits
Antoine Liutkus a****s@i****r 34
Dominik Engel d****l@m****e 3
Rémy Abergel R****l@p****r 1
Ondřej Cífka c****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 20
  • Total pull requests: 5
  • Average time to close issues: 6 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 20
  • Total pull request authors: 5
  • Average comments per issue: 2.35
  • Average comments per pull request: 0.8
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • twangnh (1)
  • catubc (1)
  • rtavenar (1)
  • pmelchior (1)
  • tseep (1)
  • JCBrouwer (1)
  • pfeatherstone (1)
  • JulianYlli12 (1)
  • adam-coogan (1)
  • stefangroha (1)
  • varun19299 (1)
  • cifkao (1)
  • diyiiyiii (1)
  • ZhangGongjie (1)
  • iago-lito (1)
Pull Request Authors
  • remy-abergel (2)
  • ybh1998 (1)
  • xeTaiz (1)
  • aliutkus (1)
  • cifkao (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 163 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: torchinterp1d

An interp1d implementation for pytorch

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 163 Last month
Rankings
Dependent packages count: 10.9%
Average: 36.1%
Dependent repos count: 61.4%
Maintainers (1)
Last synced: 11 months ago

Dependencies

setup.py pypi
  • torch >=1.6