A recurrent neural network based sorting algorithm.
RNNs can compute any arbitrary function, given finite resources since they are "Turing Complete" machines. I have used a sequence to sequence (seq2seq) based neural network model. I have chosen this model since, both the input and output are sequences. Input being unsorted sequence of integers and the output being the sorted sequence of integers.
I achieved 99.5% accuracy after 50,000 epochs.
For the purpose of evaluating the performance (in terms of correct predictions) of this algorithm, I have considered that the input sequence will be of length = 15 and that the maximum number in this sequence will be <= 100. The success rate is evaluated as (number of correct predictions)/(number of trials).
Number of Trials | Success Rate |
---|---|
100 | 97% |
1000 | 96% |
10000 | 95% |
Below is an example of sorting using deepsort -
- [ ] Try with different sequence lengths and max number.
- [ ] Add plots.
- [ ] Compare average running time with other sorting algorithms.
All patches are welcome!
MIT License - see the LICENSE file for details.