Fast Differentiable Sorting and Ranking

  • 2020-02-20 17:11:09
  • Mathieu Blondel, Olivier Teboul, Quentin Berthet, Josip Djolonga
  • 57

Abstract

The sorting operation is one of the most basic and commonly used buildingblocks in computer programming. In machine learning, it is commonly used forrobust statistics. However, seen as a function, it is piecewise linear and as aresult includes many kinks at which it is non-differentiable. More problematicis the related ranking operator, commonly used for order statistics and rankingmetrics. It is a piecewise constant function, meaning that its derivatives arenull or undefined. While numerous works have proposed differentiable proxies tosorting and ranking, they do not achieve the $O(n \log n)$ time complexity onewould expect from sorting and ranking operations. In this paper, we propose thefirst differentiable sorting and ranking operators with $O(n \log n)$ time and$O(n)$ space complexity. Our proposal in addition enjoys exact computation anddifferentiation. We achieve this feat by constructing differentiable sortingand ranking operators as projections onto the permutahedron, the convex hull ofpermutations, and using a reduction to isotonic optimization. Empirically, weconfirm that our approach is an order of magnitude faster than existingapproaches and showcase two novel applications: differentiable Spearman's rankcorrelation coefficient and soft least trimmed squares.

 

Quick Read (beta)

loading the full paper ...