Open Agrover112 opened 3 years ago
I went through the code for multi-mutation. The problem seems to be from the "gene" variable, can I get some sample test cases for running that specific function?
@pratik1424 Sure just look at the expected behaviour. It's supposed to edit multiple positions. So for ex [a,b,c,d], maybe the pos of the change is random between 0 and len(list)-1 , it could be anything from [a-/+1,b,c+/-1,d] like this!
Okay, I'll try something, I will open a PR after fixing the bug.
@pratik1424 Aare you working on it?
I tried a couple of different implementations, but the bug still persists. Main issue is the selection of gene2 and gene variables, I tried using numpy.random.uniform, but the bug remained.
👟 Reproduction steps
Implemented in: mulit_mutattion in ga_utils.py Can be tested by replacing mutation with multi_mutation in ga.py.
👍 Expected behavior
Mulit_mutattion in ga_utils.py should change N bits as selected. [1,2,3,4] for 2 bits could be: [1,3,3,5]
👎 Actual Behavior
Mulit_mutattion in ga_utils.py doesn't work as expected. Gives an Index Error when used , since the implementation is not correct.
👀 Have you spent some time to check if this issue has been raised before?