Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Attempting to run the Genetic Algorithm from mlrose on the Four Peaks problem, but it converges very fast and not sure if this is normal.
Attempting to run the Genetic Algorithm from mlrose on the Four Peaks problem, but it converges very fast and not sure if this is normal. I've used 7 different seeds and a population size of 600, and 30 iterations for each.
fitness_fn = mlrose.FourPeaks(t_pct=.1) problem = mlrose.DiscreteOpt(length=600, fitness_fn=fitness_fn, maximize=True, max_val=2) mlrose.genetic_alg(problem, pop_size=int(600), mutation_prob=0.4, max_iters=int(max_iter), random_state=seed)
1 9.0 10.0 13.0 11.0 13.0 10.0 9.0 2 11.0 12.0 115.0 11.0 13.0 16.0 9.0 3 11.0 16.0 115.0 13.0 17.0 112.0 9.0 4 13.0 16.0 119.0 13.0 17.0 112.0 9.0 5 22.0 24.0 120.0 14.0 17.0 114.0 12.0 6 22.0 24.0 120.0 20.0 17.0 116.0 12.0 7 122.0 24.0 120.0 113.0 17.0 116.0 12.0 8 122.0 24.0 120.0 114.0 17.0 117.0 12.0 9 122.0 24.0 120.0 120.0 19.0 117.0 112.0 10 122.0 112.0 120.0 123.0 19.0 117.0 112.0 11 124.0 116.0 120.0 123.0 20.0 117.0 114.0 12 124.0 121.0 120.0 123.0 20.0 117.0 114.0 13 124.0 121.0 120.0 123.0 20.0 117.0 114.0 14 125.0 121.0 120.0 123.0 20.0 117.0 115.0 15 126.0 121.0 120.0 123.0 20.0 119.0 115.0 16 127.0 121.0 120.0 123.0 21.0 119.0 115.0 17 127.0 121.0 120.0 123.0 21.0 119.0 115.0 18 127.0 121.0 120.0 123.0 21.0 119.0 117.0 19 127.0 121.0 120.0 123.0 21.0 119.0 117.0 20 127.0 121.0 120.0 123.0 114.0 119.0 122.0 21 127.0 121.0 120.0 123.0 117.0 119.0 122.0 22 127.0 121.0 120.0 123.0 119.0 119.0 122.0 23 127.0 121.0 120.0 123.0 120.0 120.0 122.0 24 127.0 121.0 120.0 123.0 121.0 123.0 122.0 25 127.0 121.0 120.0 123.0 121.0 123.0 122.0 26 127.0 121.0 120.0 123.0 121.0 123.0 122.0 27 127.0 121.0 120.0 123.0 121.0 123.0 122.0 28 127.0 121.0 120.0 123.0 122.0 123.0 122.0 29 127.0 121.0 120.0 123.0 123.0 123.0 122.0 30 127.0 121.0 120.0 123.0 123.0 123.0 122.0
The question is, why is it converging so fast and what can I do to improve?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started