Sunday, July 10, 2011

Lib FANN(Fast Artificial Neural Network Library) is a free open source neural network library written in C. In this tutorial I will show you how to use Adobe Alchemy to port FANN to Flash, step by step.

gcc -o xor_train xor_train.c -Iinclude libFANNLib.a gcc -o xor_test xor_test.c -Iinclude libFANNLib.aNow you can find the compiled exe "xor_train.exe, xor_test.exe" in the src folder.Copy "cygwin1.dll" and click to run "xor_train.exe", it will created files "xor_fixed.data, xor_fixed.net, xor_float.net". Using the cmd to run "xor_test.exe":Windows Start -> run -> cmd -> cd F:\alchemy\FANN\fann-2.1.0\srcF:xor_test.exeAnd you will see the result.

5. Now let compile the lib using alchemy:source /cygdrive/f/alchemy/alchemy-setupalc-onmake

Well, still buggy, but from the prints we see that the lib works. The errors are partially caused by that it can't find the needed files, and some linking errors, too. A better way to make the port useful is to write some wrapper functions using the Alchemy API and compile everything to a swc.