b130 dev1: Gen builder, with mutation off: some parents are breeding and deleted and others are duplicated. duplication is probably not needed anymore.

So we now have some breeding in build 130 dev 1. GREAT! But....

Standard genetic evolution usually means either strategies from the previous generation can  die off OR they remain in the pool for the next generation. Some are dying off to make room for the children which is correct, however some are dying off to make room for EXACT copies of the fittest strategies which is non standard.

I have not seen any references which would suggest that strategies should make a copy of itself and both the copy AND the original are brought forward to the next generations. This may be a bug or a misinterpretation of how genetic evolution is supposed to work or it may be an artifact from a programmer trying to fix the previous breeding bug. In theory creating a copy of itself and bringing the original AND the copy forward to next gen requires that even more of the weakest genomes die off to make room. This will reduce diversity and accelerate convergence towards local optima unnecessarily. 

Now that you have fixed breeding, we shouldn't need any duplication. Just bringing one copy of each non deleted strategy forward from the last generation should be fine.


Attachments
Screenshot 63.png
(118.48 KiB)
Screenshot 62.png
(179.78 KiB)
  • Votes +9
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

bentra

16.11.2020 19:46

Task created

b
#2

bentra

16.11.2020 19:52
Voted for this task.
b
#3

bentra

16.11.2020 20:13

Attachment Screenshot 65.png added

Screenshot 65.png
(18.78 KiB)
For clarity here is a zoom in of the strategies list I was trying to highlight. You can see by the strat name a (1) that means it is an exact copy of the strategy with the same name.


b
#4

bentra

16.11.2020 21:38

Attachment information-10-00390.pdf added

Attachment information-10-00390.zip added

information-10-00390.zip
(2.72 MiB)
information-10-00390.pdf
(2.85 MiB)
I found this in a ref:
"If it is 0%, then the complete new generation of individuals is to be exactly copied from the older population"

But I'm sure that they mean to bring a single copy of each strategy. They do not mean to make a copy and bring the original AND the copy in to the next generation.
k
#5

Karish

16.11.2020 21:46
Voted for this task.
JH
#6

Jabezz

17.11.2020 03:05
Voted for this task.
o
#7

Enric

17.11.2020 08:50
Voted for this task.
h
#8

hankeys

17.11.2020 11:29
Voted for this task.
JK
#9

Insanity82007

17.11.2020 12:24
Have you double checked the pseudo code to make sure they're actually the same?


Then convention seems to be based on island.generation.strategy 


1.0.30 seems to be island 1. generation 0. strategy 30 and when your evolution restarts after stagnation, it may find another strategy with the same name. 

JK
#10

Insanity82007

17.11.2020 12:28

Attachment Example.png added

Example.png
(19.48 KiB)

I can't edit my previous post for some reason and it meant to say "The naming convention" instead of "Then convention" 


Attached is an image of some examples of mine where I have the same strategy name, but entry and exit are different for both.
JK
#11

Insanity82007

17.11.2020 12:45
Voted for this task.
b
#12

bentra

17.11.2020 17:06
@Insanity, it's not possible for it to be from a previous restart. My screenshot is "last generation" tab which we know empties itself after each restart. 
MF
#13

Mark Fric

18.11.2020 14:34

Status changed from New to Refused

> I have not seen any references which would suggest that strategies should make a copy of itself and both the copy AND the original are brought forward to the next generations. This may be a bug or a 

> misinterpretation of how genetic evolution is supposed to work or it may be an artifact from a programmer trying to fix the previous breeding bug. In theory creating a copy of itself and bringing the original 

> AND the copy forward to next gen requires that even more of the weakest genomes die off to make room. This will reduce diversity and accelerate convergence towards local optima unnecessarily. 


no, it is intentional and exactly how it should work. There are multiple approaches to genetic programming, and it is possible that there will be multiple copies of the best strategies using elitism.

It doesn't make sense to keep the the weakest candidates and hope for some breakthrough. 

b
#14

bentra

19.11.2020 19:43

Attachment Screenshot 71.png added

Attachment Screenshot 69.png added

Screenshot 69.png
(223.94 KiB)
Screenshot 71.png
(103.17 KiB)
Aha Elitism! Excellent, thanks for the info. But maybe elitism is currently set to be a little aggressive. By generation 10 with crossover set to only 4% and mutation to 20% I have mostly the same 1 or 2 strategies filling  the 100 population island.

If I'm using decimation, then it DOES seem to make sense to leave some balance of  the strats from last generation with the elitism copies and the new children. It seems to NOT make sense to turn on "fresh blood" because that will defeat the purpose of the decimation and the elitism functions and use more CPU.

Is there a way to turn down elitism a little? Or could you please run some tests to find a better balance (if necessary) now that the breeding is fixed?

In fact it seems like I would want more breeding and less elitism if I am using stricter initial pop filters and or higher levels of decimation. So I think there's an argument for a new elitism slider bar =)
(Picture a very diverse high quality starting population where the quality is very high across the entire population. I may want to use very low or even a zero mutation which also detracts from the usefulness of elitism. In this case I would want parents mostly just mating and then only deleting strategies if the children are of even better quality. I wouldn't necessarily want to start throwing away such high quality strategies to make room for redundant copies of other slightly higher quality, it seems like it would do more harm than good in the form of reducing diversity.)

Should I open a new ticket for this request?
MF
#15

Mark Fric

20.11.2020 08:44

Status changed from Refused to Waiting for information

bendx77 - can you attach your build config here? The one that leads to the duplicate strategies.


I'll look at the cause, it shouldn't behave like this.

b
#16

bentra

20.11.2020 18:05

Attachment Screenshot 72.png added

Attachment show-elitsm.cfx added

Attachment show-convergence.cfx added

Attachment Screenshot 75.png added

Screenshot 72.png
(226.56 KiB)
Screenshot 75.png
(207.51 KiB)
show-elitsm.cfx
(29.51 KiB)
show-convergence.cfx
(29.51 KiB)
"show-elitism" config file is zero mutation and 30 crossover you can see the elitism in action on generation #1. screenshot 72. some are just copies.

"show-convergence" config file is 10% crossover and 30% mutation. You can see by generation #5 we have a single dominant strategy type in a 25 population island. Mostly just variations of the same indicators. Most of the diversity is lost by generation #5 even with a low crossover of 10%. screenshot 75. I do not wish to turn on fresh blood as this would defeat the purpose of elitism function. The combination of fresh blood with high elitism would then be defeating the purpose of decimation and high initial pop filters. Please maybe look at adding an elitism slider bar or just turning it down. Also, while you're there, please maybe look at the frequency of the breeding that specifically produces children extraordinarily similar to one parent like I complained here: https://roadmap.strategyquant.com/tasks/sq4_7258 this could also be contributing to loss of diversity too early if it's happening too much.


MF
#17

Mark Fric

25.11.2020 08:57

Status changed from Waiting for information to Fixed

The duplicates are not created only by elitism, elitism is set only for a few top strategies. It is a natural property of genetic selection algorithm that a candidate can be chosen multiple times, it is not wrong. But it shouldn't duplicate one strategy over whole population.


I made some improvements in genetic selection algorithm - no strategy should be selected to be more than 20% of the population.


b
#18

bentra

25.11.2020 17:14
Thanks for looking at this. Perhaps one day this code could be exposed to us, so many variables to experiment with!
AP
#19

AP

06.05.2021 18:29
Voted for this task.
b
#20

Burbles05

25.11.2021 06:24
Voted for this task.

Votes: +9

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please