Skip to content

dominiquegarmier/neural-nearest-neighbor

Repository files navigation

Code style: black pre-commit.ci status pytest

neural $k$ nearest neighbor

Implementation of neural k nearest neighbor in pytorch, a differentiable replacement for kNN.

Installation

pip install git+ssh://[email protected]/dominiquegarmier/neural-nearest-neighbor

and for development:

pip install -r requirements-dev.txt

Notes

When using value you have to make some additional assumtions to get the same convergence conditions as outlined in the paper. Notably you have to assume that there exists some continous $f: k \mapsto v$ that maps keys to values.

Citations

@misc{plötz2018neural,
      title={Neural Nearest Neighbors Networks},
      author={Tobias Plötz and Stefan Roth},
      year={2018},
      eprint={1810.12575},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}