问题
I want to have an artificial neural network:
- 42 input neurons
- 168 hidden neurons
- 7 output neurons
This network is to play the game of "Connect Four". At the end of each game, the network gets feedback (game result / win?).
Learning should be done with Temporal Difference Learning.
My questions:
- What values should be in my reward array?
- And finally: How can I apply it to my game now?
Thank you so much in advance!
回答1:
First hit is: you're assigning '0' to t
in 'main', but your arrays' low-bound is '1', so you're accessing a non-existing element in the loops, hence the AV.
If you had enabled range-checking in compiler options, you'd be getting a range check error and you probably would have find the reason earlier.
BTW, since I have no idea what the code is doing, I wouldn't possibly notice any other errors at this time..
回答2:
If you're interested in using a third party library (free for non-commercial products, I've been very happy with some tools from this company http://www.mitov.com/html/intelligencelab.html (although I've never used their intelligence lab, just video tools.)
回答3:
Fast Artificial Neural Network (FANN) is a good open source library, its been optimised and used by a large community, with plenty of support and delphi bindings.
Using dependencies in this area is advised if you don't fully understand what your doing, the smallest detail can have a big impact on how a neural network performs; so best spend your time on your implementation of the network, then on anything else.
回答4:
Other links that may be helpful for you:
http://delphimagic.blogspot.com.ar/2012/12/red-neuronal-backpropagation.html (Includes source code) Coding a Backpropagation neural network with two input neurons, two output and one hidden layer. The sample provides two sets of data that can train the network and see how accurate learning minimizing the error shown in a graph. Modifying the program can change the number of times the network trained with test data (epochs)
来源:https://stackoverflow.com/questions/4730083/how-to-implement-an-artificial-neural-network-in-delphi