accept_test : callable, ``accept_test(f_new=f_new, x_new=x_new, f_old=fold, x_old=x_old)``, optional
Define a test which will be used to judge whether or not to accept the
step. This will be used in addition to the Metropolis test based on
"temperature" ``T``. The acceptable return values are True,
False, or ``"force accept"``. If any of the tests return False
then the step is rejected. If the latter, then this will override any
other tests in order to accept the step. This can be used, for example,
to forcefully escape from a local minimum that ``basinhopping`` is
trapped in.
从文档https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.basinhopping.html#scipy-optimize-basinhopping
您可以从中收集的信息是调用参数
a
:a
是可调用的,因此可以提供一个函数。在a
在进化算法的决策中起作用。可能的返回值为True和False,它们与Metropolis条件(即,对于要接受的步骤,这两个条件必须返回True)和“force accept”。如果您想在大都会拒绝的情况下强制接受,则必须使用后一个选项。在下面,我建立了一个玩具示例,其中accept_test函数在参数空间中的步骤向右时强制接受
^{pr2}$相关问题 更多 >
编程相关推荐