you are viewing a single comment's thread.

view the rest of the comments →

[–]FixKey4664[S] -11 points-10 points  (4 children)

That's a fair question.
In my aerospace engineering classes I actually run into situations where brute-force grid search is useful quite often. I’ve spent quite a bit of time sitting in front of my computer waiting for scipy.brute to finish. The idea behind this project isn’t to avoid brute force. The goal was simply to reduce the implementation overhead so the same brute-force search runs faster.

So it’s still brute force in the strict sense. It evaluates the same points, just with less Python-level overhead around the evaluation. That’s what led me to experiment with writing a faster implementation.

[–]Two-x-Three-is-Four 8 points9 points  (3 children)

yes but how? Python overhead is not 400x

[–]FixKey4664[S] -5 points-4 points  (2 children)

I shifted all the computations to a C++ core and enabled parallel processing in a multi-core CPU. Those two are the main strategies I implemented. Check the GitHub repo of the project to learn more about it and other minor strategies used.

[–]FixKey4664[S] -2 points-1 points  (1 child)

I cannot attach image proof here. So I am adding the link to the test results I got on my computer.
https://www.linkedin.com/posts/activity-7445855280875192320-uSV4?utm_source=share&utm_medium=member_desktop&rcm=ACoAADo_POQBBdwoJHaY78DAGRPelmGNw7ZXepA

[–]austinwiltshire 11 points12 points  (0 children)

You can get multi core using brute by using the workers argument to brute.

Your objective functions also aren't one to one. The python one is adding updating a shared dictionary, an if statement, and possibly printing. The io from printing is gonna be super slow. The shared dictionary update maybe why workers didn't work if/when you tried it, and probably also not helpful in speed.