We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In org.encog.ml.genetic.mutate.MutatePerturb.performOperation():
As written this line will not work for small values. value += (perturbAmount - (rnd.nextDouble() * perturbAmount * 2));
It should be changed to: value += value * (perturbAmount - (rnd.nextDouble() * perturbAmount * 2));
Examples: using perturbAmount = 0.2 and random perturbation = ( (perturbAmount - (rnd.nextDouble() * perturbAmount * 2)) ) = -0.1424
using encog calculation - value = 15, perturbation % = -0.842%, new value = 14.87 value = 0.001, perturbation % = -8771%, new value = -0.086713711
VALUE FOR SMALL NUMBER IS PERTURBED BY ~9000% !
using changed code: value = 15, perturbation % = -14.24%, new value = 12.86 value = 0.001, perturbation % =-14.24%, new value = 0.000857636
Value for small number is perturbed by the requested amount.
The text was updated successfully, but these errors were encountered:
Thanks good point. I will add this soon.
Sorry, something went wrong.
MutatePerturb.performOperation calculation is not correct #148
9de5f9b
Thank you good fix. I have this in the code now.
No branches or pull requests
In org.encog.ml.genetic.mutate.MutatePerturb.performOperation():
As written this line will not work for small values.
value += (perturbAmount - (rnd.nextDouble() * perturbAmount * 2));
It should be changed to:
value += value * (perturbAmount - (rnd.nextDouble() * perturbAmount * 2));
Examples:
using perturbAmount = 0.2
and random perturbation = ( (perturbAmount - (rnd.nextDouble() * perturbAmount * 2)) )
= -0.1424
using encog calculation -
value = 15, perturbation % = -0.842%, new value = 14.87
value = 0.001, perturbation % = -8771%, new value = -0.086713711
VALUE FOR SMALL NUMBER IS PERTURBED BY ~9000% !
using changed code:
value = 15, perturbation % = -14.24%, new value = 12.86
value = 0.001, perturbation % =-14.24%, new value = 0.000857636
Value for small number is perturbed by the requested amount.
The text was updated successfully, but these errors were encountered: