默认情况下,scipy的basinhopping是随机更改步长还是自适应更改步长?

2024-10-01 02:32:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我对scipy.optimize.basinhopping中的“采取步骤”选项感到困惑:

根据online reference

The default step taking routine is a random displacement of the coordinates ... take_step can optionally have the attribute take_step.stepsize. If this attribute exists, then basinhopping will adjust take_step.stepsize in order to try to optimize the global minimum search.

然而,根据source(第587行,见下文),不管是否指定了take_step.stepsize,默认情况下,scipy的{}使用{},并将{}调整为0.9*stepsize或stepsize/0.9等。在

# use default
displace = RandomDisplacement(stepsize=stepsize)
take_step_wrapped = AdaptiveStepsize(displace, interval=interval,
verbose=disp)

因此,我从阅读basinhopping的源代码中了解到,默认情况下,该过程将自适应地将默认的stepsize(0.5)修改为一些stepsize*因子、stepsize/factor等,如下所示:Metropolis Hasting过程中接受了多少个样本。我很困惑,因为在线引用basinhopping,另一方面,似乎表明默认的stepsize将是完全随机的。在

有人能澄清吗?如果我没有为basinhopping提供任何take_step过程,那么它会随机使用stepsize进行尝试,还是会自适应地修改stepsize?谢谢。在


Tags: thetodefault过程step情况步骤attribute