Optimisation using scipy

前端 未结 2 1318
野趣味
野趣味 2021-01-14 05:04

In the following script:

import numpy as np
from scipy.optimize import minimise

a=np.array(range(4))
b=np.array(range(4,8))

def sm(x,a,b):
      sm=np.zer         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 05:49

    Modifying the proposal of FuzzyDuck, I replace sm +=((b-a)**2) which return me the desired result.

提交回复
热议问题