News for hackers. Stuff that matters.
Re:Neural programmer better than Quicksort by eru on Friday July 10, 2020 @09:37AM (#23791325)
> If this thing can efficiently almost-correctly-sort because it's better at these types of pattern matching, we can just run a final pass of insertion sort to make it useful!

Depends on what kinds of mistakes the almost-correct approach makes. If it just puts elements in the wrong order, your suggestion works. But if it makes mistakes like duplicating elements, or dropping them, or completely making up new entries, no post-processing will help.

> OTOH the standard library sort can be improved if you know the distribution of the numbers you're sorting (e.g., small numbers can bucket sort, small lists can use a sorting network, etc).

Even better: the standard library sort usually assumes only comparison. For special cases like sorting on integer keys you can conceivably do better.

Re:Neural programmer better than Quicksort by ogogmad on Friday July 10, 2020 @11:25AM (#23792447)
> Depends on what kinds of mistakes the almost-correct approach makes. If it just puts elements in the wrong order, your suggestion works. But if it makes mistakes like duplicating elements, or dropping them, or completely making up new entries, no post-processing will help.

The algorithm modifies the original list only by swapping entries. As such, it's guaranteed to result in a permutation.

Re:Neural programmer better than Quicksort by eru on Saturday July 11, 2020 @01:00AM (#23799641)
Yes, in that case the post-processing would work.

But it also limits their system to in-place algorithms only.

Re:Neural programmer better than Quicksort by gryz on Sunday July 12, 2020 @07:01AM (#23810472)
Why is this limitation? Do you think the algorithm can be improved if it was doing a copy to a new location?
Re:Neural programmer better than Quicksort by im3w1l-alt on Friday July 10, 2020 @10:58AM (#23792122)
If you let the number of objects to sort go to infinity while keeping size of objects in bits capped, then they will behave like integers.
Re:Neural programmer better than Quicksort by eru on Friday July 10, 2020 @11:03AM (#23792188)
I thought more of being able to do bit manipulation or hashing etc on your keys. Those things don't necessarily require a fixed key length. (And in some languages, even integers don't have a fixed length.)

You are right in some sense, but you'd still have trouble implementing something like bucket sort in your setting, if all you have are comparisons.