1

Problematic code:

result = differential_evolution(GA_optimisation, bounds, init=initial_GA_params, args=args)

init : str or array-like, optional Specify which type of population initialization is performed. Should be one of: array specifying the initial population. The array should have shape (M, len(x)), where len(x) is the number of parameters. init is clipped to bounds before use.

I am trying to specifying a known starting point for an optimisation. The shape of my array is (1,99), I get the below ValueError

Error:

ValueError("The population supplied needs to have shape (M, len(x)), where M > 4.")

I am unsure of what M actually is? and am unable to find it anywhere in the documentation. Could anyone help with explaining this.

4

1 回答 1

0

M 是人口规模。SciPy 中差分进化的默认值为 15。除非另有说明,否则您需要获得 M=15 的形状 (M,99)。

于 2021-01-26T14:28:09.487 回答