要自定義target函數,可以按照以下步驟進行:
custom_target
def custom_target(x, y): return x + y
target
result = minimize(fun=custom_target, x0=0)
通過以上步驟,你就可以在Python中自定義target函數,并將其用于優化器等相關操作。