我对scipy.optimize.basinhopping
中的“采取步骤”选项感到困惑:
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 adjusttake_step.stepsize
in order to try to optimize the global minimum search.
然而,根据source(第587行,见下文),不管是否指定了take_step.stepsize
,默认情况下,scipy
的{
# 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
?谢谢。在
默认情况下,步长会自适应更新。只有当您传递一个没有名为
stepsize
属性的自定义take\u step对象时,它才会被更新相关问题 更多 >
编程相关推荐