lsakizada Posted October 18, 2009 Share Posted October 18, 2009 (edited) You need to train a neural net on data, using this code: #include "_Fann.au3" Global $InputsArray[4][2] = [[-1, -1],[-1, 1],[1, -1],[1, 1]] Global $OutputsArray[4][1] = [[-1],[1],[1],[-1]] Local $ANNLayers[3] = [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() The ANN being created has 3 layers, 2 input, 3 hidden, and 1 output neuron. For my example, you need to create a neural network with 3 layers, 24 inputs in the first one, 12 hidden neurons, and 11 outputs. The training data is saved into .data files, the networks into .net. It looks like you tried to load the training data as a network. I've got it .I mixed between mousepatterns.net and mousepatterns.data Thanks! Edited October 18, 2009 by lsakizada Be Green Now or Never (BGNN)! Link to comment Share on other sites More sharing options...
Andreik Posted October 23, 2009 Share Posted October 23, 2009 (edited) I tried to make an example that learn division but is not working, anyone a little help? #include <_Fann.au3> Dim $INPUT[5][2] = [[2,1],[8,4],[12,3],[5,2],[9,1.5]] Dim $OUTPUT[5][1] = [[2],[2],[4],[2.5],[6]] Local $LAYER[3] = [2, 3, 1] _InitializeANN() $ANN = _CreateAnn(3,$LAYER) _ANNSetActivationFunctionHidden($ANN, $FANN_SIGMOID_SYMMETRIC) _ANNSetActivationFunctionOutput($ANN, $FANN_SIGMOID_SYMMETRIC) _ANNTrainOnData($ANN,$INPUT,$OUTPUT, 15000, 1000,0.001) _ANNSaveToFile($ANN, "num_div.net") _DestroyANN($ANN) _CloseANN() Dim $CALC[2] = [4,1] _InitializeANN() $ANN = _ANNCreateFromFile("num_div.net") $RESULT = _ANNRun($ANN,$CALC) MsgBox(0,"Division", $CALC[0] & " / " & $CALC[1] & " = " & $RESULT[0]) _DestroyANN($ANN) _CloseANN() Edited October 23, 2009 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Jjo Posted October 24, 2009 Share Posted October 24, 2009 Looks interesting but every time when I run some of the scripts here it doesn't work. C:\Program Files\AutoIt3\Include\_Fann.au3 (48) : ==> Subscript used with non-Array variable.: Return $hAnn[0] Return $hAnn^ ERROR Projects: -Handy Musicplayer Link to comment Share on other sites More sharing options...
JRowe Posted October 24, 2009 Author Share Posted October 24, 2009 @Andreik, try different numbers of neurons and hidden layers between your inputs and outputs, it could be that the relation you're trying to model is more complex than can be represented with just 3 neurons. It will take some trial and error, but I think it can be done. Maybe try 2 hidden layers with 4 neurons each? Local $LAYER[3] = [2, 4, 4, 1] @Jjo, the include folder isn't for scripts that you download, that's used for core AutoIt includes. Put _Fann.au3 in the same directory as the script you're trying to use, and do #include "_Fann.au3". The error is meaningless without knowing what script you're running, what directory the dll is in, and so on. So, let me know more information. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Jjo Posted October 24, 2009 Share Posted October 24, 2009 @Jjo, the include folder isn't for scripts that you download, that's used for core AutoIt includes. Put _Fann.au3 in the same directory as the script you're trying to use, and do #include "_Fann.au3".The error is meaningless without knowing what script you're running, what directory the dll is in, and so on. So, let me know more information. Ok that worked, thanks. Projects: -Handy Musicplayer Link to comment Share on other sites More sharing options...
MartiniThePilot Posted October 30, 2009 Share Posted October 30, 2009 Wow! Really great stuff! Thank you for sharing! Regards, Martini Link to comment Share on other sites More sharing options...
Piyush Posted September 23, 2011 Share Posted September 23, 2011 Its stilll not working for me...I am also getting the same error as that of jijo. The udf, the dll file and the example file is in the same directory still it is not working. plz help..!! [font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font] Link to comment Share on other sites More sharing options...
Zibit Posted October 8, 2011 Share Posted October 8, 2011 Wow, This is spectacular. I've always seen in AutoIt's AI department great potential, but this exceeds all expectations. Been working on AI's for a while now and i can say just by looking a this, that it will speed up my work exponentially. I give my thanks. Zibit Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
ViRnik Posted November 2, 2011 Share Posted November 2, 2011 any more info from ppl using this? its interesting topic. Link to comment Share on other sites More sharing options...
mercessb Posted January 5, 2013 Share Posted January 5, 2013 cant download fannfloat.dll! Please help Link to comment Share on other sites More sharing options...
Uten Posted June 5, 2018 Share Posted June 5, 2018 First my appology for resurecting this thread. But I'm curious, and someone monitoring this thread from way back might have good answers. 1: Does anyone use FANN (with autoit) these days? 2: Does anyone use it on win64? To me it looks like a wraper to handle pointers to structs are needed between the library and AutoIt? 3: Is there any other Neural Network Library in use with AutoIt? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now