4 ms·
For those playing along at home (like me): even though it's only to highlight the idea, there's a bug in the "Random Local Search" loop. It should be `x_try = b
by mrspeaker 12y ago
For those playing along at home (like me): even though it's only to highlight the idea, there's a bug in the "Random Local Search" loop. It should be `x_try = best_x + tweak_amount...` best_x, not x. Same for y. I was wondering why it wasn't improving even with 1e10 iterations ;)
- olivier1664 12y agoAfter correction: 100 iterations give best_x = -1.76, best_y = 2.91, best_out = -5.15 10,000,000 iterations (less than 1 sec CPU) give best_x = 16,657, best_y = 16,662, best_out = 277,541,583 https://jsfiddle.net/fe068f0L/ https://jsfiddle.net/fe068f0L/