So I made a neural network... How do I use it?

Hello, I just made a neural network from watching a guide, but I’m not quite sure how to implement it into a game, all I want is to have it learn to jump over obstacles, thanks

Like others have already mentioned your question is way too general. There are countless different neural network designs and concepts out there. Apart from that there are also countless different ways how to actually train or modify the network to get closer to what you actually want it to do. That’s actually another big factor: What is your actual use case? If you compare a neural network to a car then the main purpose of a neural network is just a mathematical mapping of some inputs to some outputs. Just like the purpose of a car is to get you from a point A to point B. Of course there are many different nuances how one would use a car but the basic principle is always the same.

If you want to learn more about neural networks I highly recommend the 3Blue1Brown series on neural networks.

Actually setting up a neural network requires specific details on the actual usecase. Like @jmurnanedev said you usually have a fittness function in order to determine how “well” the network behaves. There are many different ways how you can improve a neural network. One is through generational mutation, another one is through back propergation. Both general directions work entirely different and have countless different implementations and aspects to it. So just for example generational mutation is usually done by duplicating the network and applying some small random changes to some random elements and test the result. However such test runs are often grouped into test groups / generations and at the end of a test run you choose the generation that has performed the best. If multiple different goals should be achieved at once it’s also possible to try to “breed” two or more networks together by combining them into one network by taking some weight from the first network and some from the other or by calculating the mean between them.

Backpropergation is quite math heavy and depends on the active learning towards a certain goal. So you have to have a large set ot test input where you know the wanted output. So you just run the test input through the network and see what the output is and what the expected output should be. From that you can calculate the error (the difference between the wanted output and the actual output) and slightly adjust all the weights in such a way you get closer to the “correct” output. This process has to be repeated many many times.

If you have a lot of free time I can also recommend to watch the AI series of Computerphile. Though the playlist doesn’t seem to include the first videos.

For some reason UA has lost the whole bottom of my answer -.-

Anyways I just had some additional links to the feed forward ANN I wrote a few years ago as well as this question which was about life simulation with an ANN. Note that my implementation is not meant to be fast or performant. It’s just a simple straight forward OOP approach.