SciML/Optimization.jl

Add `sense` support for all algorithms

開放

#976 建立於 2023年6月1日

 (4 則留言) (1 個反應) (1 位負責人)Julia (99 個分叉)batch import
good first issue

倉庫指標

星標
 (824 顆星)
PR 合併指標
 (平均合併 2天 1小時) (30 天內合併 20 個 PR)

描述

Currently sense is only supported for a subset of algorithms. This breaks the common interface as some solvers solve min vs max. Furthermore, since sense is a kwarg for OptimizationProblem and not solve, the interface and docs give the impression that it is supported for all algorithms.

using Optimization, OptimizationBBO

J(x,p) = x

F = OptimizationFunction(J)
prob = Optimization.OptimizationProblem(F, 0.0; lb = -10, ub =10, sense = MaxSense)
solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited()).objective # -10.0

貢獻者指南