google-research / fast-soft-sort

Fast Differentiable Sorting and Ranking
Apache License 2.0
570 stars 47 forks source link

Feature Request: Configurable comparator function #1

Closed Ghost---Shadow closed 4 years ago

Ghost---Shadow commented 4 years ago

This is good.

Is there a way to configure the comparator function?

My plan was to have a neural network as the comparator function and it would learn from already sorted/ranked sequences.

mblondel commented 4 years ago

It's not entirely clear how we could do that with our isotonic regression based approach. Where would you insert the comparator function?

Ghost---Shadow commented 4 years ago

Something like this. I implemented Bubble sort with a learnable comparator function

https://github.com/Ghost---Shadow/differentiable-programming-handbook/blob/master/notebooks/bubble-sort.ipynb

mblondel commented 4 years ago

It's easy to do for bubble sort, not so obvious for our isotonic regression based approach. I don't think we'll be able to implement this so I'm closing the issue.