Passing args in scipy optimize.minimize objective function ( getting error on number of arguments)

后端 未结 1 1778
清酒与你
清酒与你 2020-12-07 02:20

I\'m trying to use scipy\'s optimizer.minimize function but I\'m unable to figure out exact way to pass args to objective function. I have following code which according to

相关标签:
1条回答
  • 2020-12-07 03:02

    Change args=(parameter) to args=(parameter,), so args is a tuple containing a single element.

    args=(parameter) is equivalent to args=parameter. When you do that, each element of parameter is passed as a separate argument to your objective function.

    0 讨论(0)
提交回复
热议问题