1
$\begingroup$

I'd like to make an AI learning how to play 2048 game. I decided to try a genetic algorithm, since I don't have any test examples of correct moves. So my AI should choose one from four possible moves (UP, DOWN, LEFT and RIGHT). I've previously done only a neural network (well, it's hard to call it a "network" actually, it only had one neuron) with two possible outputs, either 1 or 0. This time I'd need to have four. I've come up with an idea to make four output neurons, that instead of 0 or 1 would return a value between 0 and 1. Then I'd choose the neuron with the greatest value and make a corresponding move. Is it a good idea?

$\endgroup$
  • $\begingroup$ I just provided an answer to a similar question stats.stackexchange.com/questions/359515/…. $\endgroup$ – Edv Beq Jul 28 '18 at 19:13
  • $\begingroup$ Well... to be honest I do not really see too much similarities between my question and the one that you answered. I'm just asking how to decide what move should my AI make. I can't choose more than one move at the same time. If I'd make four output neurons that would return 0 or 1, it is very likely that more than one neuron would return 1 or all the neurons would return 0 and I wouldn't be able to tell what move is the best. I have to somehow force that always only one neuron returns 1. $\endgroup$ – Maras Jul 28 '18 at 19:41
  • $\begingroup$ A neural network can have as many inputs and outputs as you desire. The output of the network can be normalized with other functions such as softmax for example. Someone smarter than me can tell you more. $\endgroup$ – Edv Beq Jul 28 '18 at 19:54
1
$\begingroup$

Yep, this is basically how multiple output networks work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.