[Python] Multiprocessing with SciPy Optimize

Discussão em 'Python' iniciado por Stack, Junho 2, 2025.

  1. Stack

    Stack Membro Participativo

    Question: Does scipy.optimize have minimizing functions that can divide their workload among multiple processes to save time? If so, where can I find the documentation?

    I've looked a fair amount online, including here, for answers:


    I could be misunderstanding, but I don't see a clear indication in any of the above posts that the scipy library is informed of the fact that there are multiple processes that it can utilize simultaneously while also providing the minimization functions with all of the arguments needed to determine the minimum.

    I also don't see multiprocessing discussed in detail in the scipy docs that I read and I haven't had any luck finding real world examples of optimization gains to justify optimizing versus a parallel brute force effort. Here's a fictional example of what I'd like the scipy.optimize library to do (I know that the differential_evolution function doesn't have a multiprocessing argument):

    import multiprocessing as mp
    from scipy.optimize import differential_evolution

    def objective_function(x):
    return x[0] * 2

    pool = mp.Pool(processes=16)

    # Perform differential evolution optimization
    result = differential_evolution(objective_function, multiprocessing = pool)

    Continue reading...

Compartilhe esta Página