You are browsing as a guest. Sign up (or log in) to start making projects!

Number Guessing Neural Network

  • 3 Devlogs
  • 13 Total hours

A neural network that tries to learn binary search for winning a number guessing game.

Open comments for this post

3h 45m 33s logged

I decided to implement the change where the model outputs a number between 0 and 1 to represent somewhere within the high/low range of numbers it can currently guess between, and also added a new input to the neural network telling it the number of guesses so far. Both of these changes drastically improved the model and now it averages around 9 guesses to find the number, which is an amazing result. I only got to this after playing around with trying to change the fitness function again to not much success, but I am glad this idea worked. Next time I work on it I will add a user interface on an online website with the final trained model so people can try it out.

0
0
3
Open comments for this post

5h 15m 5s logged

After training it overnight it was able to solve the game in an average of 35 attempts, however as I cut it off after 50 I reckon the actual attempts would be much higher. Due to this lack of performance, I have decided to try and improve the fitness function so that it trains more effectively. I spent many hours trying to modify the fitness function and test it hoping that it would lead to a better solve rate but so far I am without success. It would keep repeatedly guessing the same number so I added a penalty if it guesses the same number as the round before. It would then alternate between guessing two numbers, so I tried to increase the reward if it got a correct solve. After those changes and a few other experiments, I was still unable to get it to train properly and seems to still perform poorly with the new fitness function after 1000 generations of training. The graph below shows the fitness of the best model per generation, and you can see quick initial improvement before it stagnates for the rest of the training time. I am considering changing the output from being a number between 1 and 1000 to being a number within the high/low range, where 0 represents the current low and 1 represents the current high, and hopefully after training it would learn to guess around 0.5 each time. Another strategy I could implement would be to give the network more information, such as guesses from even more rounds, round number, or width of the search interval and maybe increase the number of hidden layers and/or neurons in those hidden layers.

0
0
12
Open comments for this post

3h 53m 55s logged

I am trying to make an evolutionary neural network which plays a number guessing game where it has to try and guess a random number between 1 and 1000 in as little attempts as possible, and I am hoping that it will learn binary search from scratch, which would be cool. The first version that I made had a very low solve rate as I hadn’t done the fitness function very well, but this version I have changed the fitness function and a 50 generation quick run was showing good results, so I am going to run it with 10000 generations and then go to sleep, and hopefully when I wake up it will be done fingers crossed. Let me know if you have any other interesting number games/number related things I could try and train it to do, any ideas are welcome!

0
0
18

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…