Does anyone know what the inputs and outputs of a neural network that sorts numbers would look like?
Does anyone know what the inputs and outputs of a neural network that sorts numbers would look like?
Output: the same, sorted.
At least that's one dead simple way to formulate the problem, multiple other solutions would work as well, and some would probably work better.
another improvement could be "enhancing" of the inputs: when you figure out how you will permute the numbers to sort them, create specific and randomized variations of that specific list of numbers and feed the learning algorithm with the correct results of those permutations too. for instance if you have 5 70 2 13 as a training input, the trainer algorithm could generate the following extra inputs based on this so that the algorithm will get a better chance of figuring out the sorting for a test input like 2 15 5 65:
2 5 23 70 2 5 33 70 ... 2 5 63 70 2 5 73 70 also: 2 5 14 70 2 5 13 69 etc. also modify more than 1 number at the same time(both systematically and also randomly) to generate even more "gray"-input
Example sorting 987654 and 123456
Input: 1, .9, .8, .7, .6, .5, .2, .3, .4, .5, .6, .7
Expected output: .2, .3, .4, .5, .6, .7, 1, .9, .8, .7, .6, .5
You can then encode/decode the inputs and outputs accordingly. if (value <= 1) digit = 9; if (value <= 0.9) digit = 8; ... if (value <= 0.2) digit = 1; if (value <= 0.1) digit = 0; etc.I'm able to get 100% accuracy on a limited training set with 2 hidden layers of 10 nodes. 33% accuracy on the test set (but likely need a lot more data to train with).