Discussion of article "Neural networks made easy (Part 30): Genetic algorithms"

 

New article Neural networks made easy (Part 30): Genetic algorithms has been published:

Today I want to introduce you to a slightly different learning method. We can say that it is borrowed from Darwin's theory of evolution. It is probably less controllable than the previously discussed methods but it allows training non-differentiable models.

he optimization process was tested with all previously used parameters. The training sample is the EURUSD H1 historical data. For the optimization process, I used the history for the last 2 years. The EA was used with default parameters. As a model for testing, I used architectures from the previous article with the search for the optimal probability distribution of decision making. This approach enables the substitution of the optimized model into the "REINFORCE-test.mq5" Expert Advisor used earlier. As you can see, this is the third approach in the process of training a model of the same architecture. Previously, we have already trained a similar model using the Policy Gradient and Actor-Critic algorithms. So, it is even more interesting to observe the optimization results.

When optimizing the model, we did not use the last-month data. Thus, we left some data for testing the optimized model. The optimized model was run in the Strategy Tester. It generated the following result.

Optimized model testing graph

As you can see from the presented graph, we got a growing balance graph. But its profitability is a bit lower than that obtained when training a similar model using the Actor-Critic method. It also executed less trading operations. Actually, the number of trades decreased by two times.

Chart with the model trading history

Author: Dmitriy Gizlyk

 

It is curious why it is the trend orientation that results. Usually, if the task is to find regularities, then, given the zigzag growth of almost any trend, the neural network should find profitable and use a counter-trend strategy in parallel, opening at the expected extrema, especially in case of prolonged growth. The previous experience (article 29) has something similar, where the balance curve grows throughout the whole period, while here it gradually fades.


Dmitriy Gizlyk
Проведите свои эксперименты и будет интересно понаблюдать за их результатами.


It is great that there is an opportunity to twist the implementation in your hands.
Unfortunately, it is not tested. Tried to go into the editor, it crashes when compiling. I seem to have copied all files when viewing all articles.
Please advise me what I need to do.

 
I deleted namespace Math and curly braces in one of the include files,
Then I deleted "Math:::" before the problematic function in the code, and I think it stopped swearing.

Now it returns Init 1.
I've pinned where from, it turns out that it is swearing at the model in this function. I don't understand what to do.

I thought I should create it with the help of transfer, but I didn't find in the articles how to do it for Geneticist.

Please help me to start this car
 
Ivan Butko #:
I deleted namespace Math and curly braces in one of the include files ,
Then I deleted "Math:::" before the problematic function in the code, and I think it stopped swearing.

Now it returns Init 1 .
I've pinned where from, it turns out that it is swearing at the model in this function. I don't understand what to do.

I thought I should create it using transfer, but I didn't find in the articles how to do it for Geneticist.

Please help me to start this machine

For training in the article, I used a model similar to the one trained in the article actor-critic and policy gradient. You just give the Expert Advisor a regular model. And it supplements it with models similar in architecture until the population is filled.

 

hi, appreciate pretty much on your great effort for these series of articles, but when i try to run evolution EA,or Genetic EA, i got an error of 5109, which i turned to MQ5 guide book and found ,this error is caused by OPENCL.

I got an error of 5109, which i turned to MQ5 guide book and found ,this error is caused by OPENCL... ,can you tell me how to run this error? I got an error of 5109, which i turned to MQ5 guide book and found ,this error is caused by OPENCL.

can you tell me how to fix this problem? anyway, thank you very much...

ERR_OPENCL_EXECUTE

ERR_OPENCL_EXECUTE

OpenCL programme Runtime error


 
Dimitri, how long does it take to learn a model? I've had 300 epochs and the result hasn't changed. Is this normal? And is there any way to quickly reset the weights to random via your NetCreator without manually recreating the model?