Stochastic Optimization of Sorting Networks via Continuous Relaxations

Aditya Grover, Eric Wang, Aaron Zweig, Stefano Ermon
3/21/2019
stat.MLcs.LGcs.NE

Official code: ermongroup/neuralsort (151 stars, Python, MIT, last commit 2023-03-24).

Abstract

Sorting input objects is an important step in many machine learning pipelines. However, the sorting operator is non-differentiable with respect to its inputs, which prohibits end-to-end gradient-based optimization.

Show full abstract

In this work, we propose NeuralSort, a general-purpose continuous relaxation of the output of the sorting operator from permutation matrices to the set of unimodal row-stochastic matrices, where every row sums to one and has a distinct arg max. This relaxation permits straight-through optimization of any computational graph involve a sorting operation. Further, we use this relaxation to enable gradient-based stochastic optimization over the combinatorially large space of permutations by deriving a reparameterized gradient estimator for the Plackett-Luce family of distributions over permutations. We demonstrate the usefulness of our framework on three tasks that require learning semantic orderings of high-dimensional objects, including a fully differentiable, parameterized extension of the k-nearest neighbors algorithm.

View on arXivView PDF

Code Implementations(1)

MIT

Code for "Stochastic Optimization of Sorting Networks using Continuous Relaxations", ICLR 2019.

15126PythonFeb 25, 20193 years agoMIT

Similar Papers

Cite this paper

@article{grover2019stochastic,
  title  = {Stochastic Optimization of Sorting Networks via Continuous Relaxations},
  author = {Aditya Grover and Eric Wang and Aaron Zweig and Stefano Ermon},
  year   = {2019},
  eprint = {1903.08850},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1903.08850}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1903.08850.svg)](https://codeofpaper.com/paper/1903.08850)

Discussion