FANN and Fann2mql questions

 

Hello,

I trying to find out if anyone has any expierence working with Fann2mql neural networks. I read a few articles on hear and adapted some of the code to meet my parameters, however I am having an issue with training the neural network. I notice that the f2m_train() only has 3 parameters, (NN, inputs, outputs), So it only does 1 interation. I ran the function through a loop for 10000 times to see if that would work as the iterations, but it doesnt seem to be training the data (i printed eash MSE of the iterations for the first 50 and th though the MSE was dropping it was hardly moving). Another reason for me thing that the training isnt learning is I have approx 125 case of 16 inputs that lead to 1 output (hidden layers 8 & 2). when i trained the data the MSE remained virtually unmoved and the whole learning process took less then 3 mins. when I run a similar network in excel (i have a NN addon) it takes the same network to train in roughly 10,15 mins and the MSE drastically drops to almost my target MSE.

Looking at the FANN i think the correct function i need to use to train my data is fann_train_on_data(). This trains the network on the entire dataset over a period of time. I looked in the f2m library and there is no function like the FANN on. is there a way to use FANN in meta trader and call upon FANN functions.

Any help would be much appreciated

 

Yes. Please read carefully my article:

Please note that this article shows only the very basic usage of Fann2MQL. As this package is not much more than FANN you can use all the tools designed for managing FANN networks, like:

Fann2MQL is hardly useful for training. MQL is oriented for EA that is executing the strategy on every tick not on datasets. Mostly it would take to much time for training on data sets before the next tick arrives.

The proper workflow is (once you invented your strategy of course ;):

1. Obtain data sets for the network from MT (probably save it from the MQL4/5 script), make sure to normalize it and organize it the way you want it to be organized (for example like sliding window). Make sure to split it to 3 sets (one used for training, the other used for optimizing MSE and the third one for actual verification of your strategy).

2. Use Fanntool / FannExplorer or any other tool to design your network, train it and so on.

3. Use the trained network in you EA.

4. Don't forget to buy me a Porshe if you succeed ;)

 
Freebird83:

Hello,

I trying to find out if anyone has any expierence working with Fann2mql neural networks. I read a few articles on hear and adapted some of the code to meet my parameters, however I am having an issue with training the neural network. I notice that the f2m_train() only has 3 parameters, (NN, inputs, outputs), So it only does 1 interation. I ran the function through a loop for 10000 times to see if that would work as the iterations, but it doesnt seem to be training the data (i printed eash MSE of the iterations for the first 50 and th though the MSE was dropping it was hardly moving). Another reason for me thing that the training isnt learning is I have approx 125 case of 16 inputs that lead to 1 output (hidden layers 8 & 2). when i trained the data the MSE remained virtually unmoved and the whole learning process took less then 3 mins. when I run a similar network in excel (i have a NN addon) it takes the same network to train in roughly 10,15 mins and the MSE drastically drops to almost my target MSE.

Looking at the FANN i think the correct function i need to use to train my data is fann_train_on_data(). This trains the network on the entire dataset over a period of time. I looked in the f2m library and there is no function like the FANN on. is there a way to use FANN in meta trader and call upon FANN functions.

Any help would be much appreciated

I am using FANN and epoch limitation can be solved through the use of the Tester with the Genetic algorythm.

Google FANN-EA to review the expert and info on MQL4 Forum

Hope this helps..

KomodoDragon

Reason: