facebookresearch / facebookresearch/pytorch3d

Custom distance function in KNN

Open
#1,012 4 comments 0 reactions 2 assignees Claimed by @gkioxari View on GitHub
enhancement
Dominant language
Python
Stars
10k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature

Use of custom distance function while calculating k nearest neighbour.

NOTE: Please look at the existing list of Issues tagged with the label ['enhancement`](https://github.com/facebookresearch/pytorch3d/issues?q=label%3Aenhancement). **Only open a new issue if you do not see your feature request there**.

## Motivation

It would be great if we can use custom distance function while calculating k nearest neighbour instead of euclidean distance.

## Pitch

In Molecular dynamics simulations, the simulations are carried out in a fixed size box so while calculating k nearest neighbour we have to use periodic boundary condition and minimum image convention so it will be convenient if we can pass custom distance function for calculating the distance.

For example:

Box boundaries (3,3,3)

Point 1 coordiante: (0.2,0.2,0.2)
Point 2 coordinate: (2.7,2.7,2.7)

Euclidean distance: 4.33
Pbc distance: 0.866

NOTE: we only consider adding new features if they are useful for many users.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.