I'm using the Fann(Fast Artificial Neural Network) library. This is the best open source package I could find, and has many interesting features. I've created the functionality in AutoIt to do everything except the callbacks, c-level convenience functions, and the cascade training system. I'll be adding the cascade system sometime soon.
Neural nets are powerful computational devices that can be used for many things, such as OCR, pathing, targeting, threat detection, function approximation, document sorting, and more.
fannfloat.dll 186.5KB 644 downloads
_Fann.au3 27.02KB 920 downloads
[[previous downloads: 14]]
Here's an example. This will create a neural net, train it on some data, and save it to a file called "xor_float.net."
#include "_Fann.au3" Global $InputsArray = [[-1, -1],[-1, 1],[1, -1],[1, 1]] Global $OutputsArray = [[-1],,,[-1]] Local $ANNLayers = [2, 3, 1] _InitializeANN() $Ann = _CreateAnn(3, $ANNLayers) _ANNSetActivationFunctionHidden($Ann, $FANN_SIGMOID_SYMMETRIC) _ANNSetActivationFunctionOutput($Ann, $FANN_SIGMOID_SYMMETRIC) _ANNTrainOnData($Ann, $InputsArray, $OutputsArray, 5000, 10, 0.001) _ANNSaveToFile($Ann, "xor_float.net") _DestroyANN($Ann) _CloseANN()
Now you have a neural net that is trained to handle the logic of XOR. It takes two inputs and returns one output.
To use the neural net, you'll have to load it, and run some input through it to see what it produces.
The neural net will return an approximation of the XOR value for the pair of inputs you give it. (1 or -1)
If (1,1) or (-1,-1) then it returns something like -.969.
If (-1,1) ir (1,-1) then it will return something like .934
I'll provide a more useful example in the form of a mouse gesture recognition neural net sometime later, but I thought I'd share this now. I hope at least a few people are as excited as I am. This should provide a significant boost to AutoIt's AI firepower.
Documentation is located at: http://leenissen.dk/fann/html/files/fann-h.html
If there are questions, fire away. I'll answer as best I can.
Oh, and before I forget... My everlasting gratitude and thanks to the following, in no particular order:
monoceres, valik, RichardRobertson, trancexx, martin, manadar, and Smoke_N, for the help and teaching they've given me. Thanks, guys (+gal)!
Edited by JRowe, 14 October 2009 - 09:50 AM.