问题
When running scipy optimize minimum using the L-BFGS-B method, I found that on certain computers, it uses all 8 cpu cores (see photo 1), on others it uses 4 out of 8 cores (see photo 2) and on others it only uses 1 core. I have not used any libraries/code to make it parallel -- it seems to be doing that by default.
Is there a way that I can specify how many cores it should use easily? I couldn't find anything online that suggested scipy optimize uses parallelisation by default.
fmin = scipy.optimize.minimize(fun=mf.nncostfunction3, x0=theta_initial_ravel, args=(input_layer_size, hidden_layer_size1, num_labels, x_train, y_train, lambda_reg), method=minimisation_method, jac=True, options={'maxiter': iteration_number, 'disp': use_minimisation_display})
answer = fmin.x
On my desktop, it uses all 8 out of 8 cores
On my latpop, it uses all 4 out of 8 cores
来源:https://stackoverflow.com/questions/40770005/scipy-optimise-minimize-parallelisation-options