All Projects → google-research → Fast Soft Sort

google-research / Fast Soft Sort

Licence: apache-2.0
Fast Differentiable Sorting and Ranking

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Fast Soft Sort

Sortingalgorithm.hayateshiki
Hayate-Shiki is an improved merge sort algorithm with the goal of "faster than quick sort".
Stars: ✭ 84 (-64.26%)
Mutual labels:  sorting
Rummage phoenix
Full Phoenix Support for Rummage. It can be used for searching, sorting and paginating collections in phoenix.
Stars: ✭ 144 (-38.72%)
Mutual labels:  sorting
React Table
⚛️ Hooks for building fast and extendable tables and datagrids for React
Stars: ✭ 15,739 (+6597.45%)
Mutual labels:  sorting
Krypton Outlookgrid
Krypton customized version of the .NET Winforms DataGridView (C#) that allows multi-grouping and multi-sorting. Featuring a TreeGrid mode, conditional formatting and additional custom columns.
Stars: ✭ 96 (-59.15%)
Mutual labels:  sorting
Vue Table Dynamic
🎉 A dynamic table with sorting, filtering, editing, pagination, multiple select, etc.
Stars: ✭ 106 (-54.89%)
Mutual labels:  sorting
Visualizer
A single-page website aiming to provide innovative and intuitive visualizations of common and AI algorithms.
Stars: ✭ 163 (-30.64%)
Mutual labels:  sorting
Filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL.
Stars: ✭ 83 (-64.68%)
Mutual labels:  sorting
Tablesorter
Github fork of Christian Bach's tablesorter plugin + awesomeness ~
Stars: ✭ 2,532 (+977.45%)
Mutual labels:  sorting
Ips4o
In-place Parallel Super Scalar Samplesort (IPS⁴o)
Stars: ✭ 137 (-41.7%)
Mutual labels:  sorting
Rummage ecto
Search, Sort and Pagination for ecto queries
Stars: ✭ 190 (-19.15%)
Mutual labels:  sorting
React Sortable Hoc
A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️
Stars: ✭ 9,747 (+4047.66%)
Mutual labels:  sorting
Quadsort
Quadsort is a stable adaptive merge sort which is faster than quicksort.
Stars: ✭ 1,385 (+489.36%)
Mutual labels:  sorting
Muuri React
The layout engine for React
Stars: ✭ 163 (-30.64%)
Mutual labels:  sorting
Algorithms
In case you want to contribute, ping on https://gitter.im/NITSkmOS/algo.
Stars: ✭ 95 (-59.57%)
Mutual labels:  sorting
Deepsort
🧠 AI powered image tagger backed by DeepDetect
Stars: ✭ 209 (-11.06%)
Mutual labels:  sorting
Tupl
The Unnamed Persistence Library
Stars: ✭ 83 (-64.68%)
Mutual labels:  sorting
Vuejs Datatable
A Vue.js component for filterable and paginated tables.
Stars: ✭ 148 (-37.02%)
Mutual labels:  sorting
Rutorika Sortable
Adds sortable behavior to Laravel Eloquent models
Stars: ✭ 241 (+2.55%)
Mutual labels:  sorting
Cpp Timsort
A C++ implementation of timsort
Stars: ✭ 211 (-10.21%)
Mutual labels:  sorting
Vue Bootstrap4 Table
Advanced table based on Vue 2 and Bootstrap 4 ⚡️
Stars: ✭ 187 (-20.43%)
Mutual labels:  sorting

Fast Differentiable Sorting and Ranking

Differentiable sorting and ranking operations in O(n log n).

Dependencies

  • NumPy
  • SciPy
  • Numba
  • Tensorflow (optional)
  • PyTorch (optional)

TensorFlow Example

>>> import tensorflow as tf
>>> from fast_soft_sort.tf_ops import soft_rank, soft_sort
>>> values = tf.convert_to_tensor([[5., 1., 2.], [2., 1., 5.]], dtype=tf.float64)
>>> soft_sort(values, regularization_strength=1.0)
<tf.Tensor: shape=(2, 3), dtype=float64, numpy= array([[1.66666667, 2.66666667, 3.66666667], [1.66666667, 2.66666667, 3.66666667]])>
>>> soft_sort(values, regularization_strength=0.1)
<tf.Tensor: shape=(2, 3), dtype=float64, numpy= array([[1., 2., 5.], [1., 2., 5.]])>
>>> soft_rank(values, regularization_strength=2.0)
<tf.Tensor: shape=(2, 3), dtype=float64, numpy= array([[3. , 1.25, 1.75], [1.75, 1.25, 3. ]])>
>>> soft_rank(values, regularization_strength=1.0)
<tf.Tensor: shape=(2, 3), dtype=float64, numpy= array([[3., 1., 2.], [2., 1., 3.]])>

JAX Example

>>> import jax.numpy as jnp
>>> from fast_soft_sort.jax_ops import soft_rank, soft_sort
>>> values = jnp.array([[5., 1., 2.], [2., 1., 5.]], dtype=jnp.float64)
>>> soft_sort(values, regularization_strength=1.0)
[[1.66666667 2.66666667 3.66666667]
 [1.66666667 2.66666667 3.66666667]]
>>> soft_sort(values, regularization_strength=0.1)
[[1. 2. 5.]
 [1. 2. 5.]]
>>> soft_rank(values, regularization_strength=2.0)
[[3.   1.25 1.75]
 [1.75 1.25 3.  ]]
>>> soft_rank(values, regularization_strength=1.0)
[[3. 1. 2.]
 [2. 1. 3.]]

PyTorch Example

>>> import torch
>>> from pytorch_ops import soft_rank, soft_sort
>>> values = fast_soft_sort.torch.tensor([[5., 1., 2.], [2., 1., 5.]], dtype=torch.float64)
>>> soft_sort(values, regularization_strength=1.0)
tensor([[1.6667, 2.6667, 3.6667]
        [1.6667, 2.6667, 3.6667]], dtype=torch.float64)
>>> soft_sort(values, regularization_strength=0.1)
tensor([[1., 2., 5.]
        [1., 2., 5.]], dtype=torch.float64)
>>> soft_rank(values, regularization_strength=2.0)
tensor([[3.0000, 1.2500, 1.7500],
        [1.7500, 1.2500, 3.0000]], dtype=torch.float64)
>>> soft_rank(values, regularization_strength=1.0)
tensor([[3., 1., 2.]
        [2., 1., 3.]], dtype=torch.float64)

Install

Run python setup.py install or copy the fast_soft_sort/ folder to your project.

Reference

Fast Differentiable Sorting and Ranking Mathieu Blondel, Olivier Teboul, Quentin Berthet, Josip Djolonga In proceedings of ICML 2020 arXiv:2002.08871

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].