-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
For dlib.find_min_global argument is_integer_variable is not give the optimum parameter.
I tried my function with Floating variables and this work Super.
But with is_integer_variable = True, it seems not working or have bug.
Here I tried with small function.
import dlib
import numpy as np
def funcToOptimize(*args):
return np.sum(np.square(np.array(args)))
LB = [0 for i in range(10)]
UB = [65000 for i in range(10)]
x_opt, y_opt = dlib.find_min_global(funcToOptimize, LB, UB, 100) #First Option with Floating variables and max_function_calls=100
print(x_opt, y_opt)
Output : [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] 0.0 # almost Zero
IsInteger = [True for i in range(10)]
x_opt, y_opt = dlib.find_min_global(funcToOptimize, LB, UB, IsInteger, 300) #Second Option with Integer variables and max_function_calls=300
print(x_opt, y_opt)
Output : [510.0, 90.0, 46.0, 4318.0, 3745.0, 2197.0, 11329.0, 646.0, 9873.0, 9572.0] 355630144.0
x_opt, y_opt = dlib.find_min_global(funcToOptimize, LB, UB, IsInteger, 400) #Third Option with Integer variables and max_function_calls=400
print(x_opt, y_opt)
Output : [510.0, 90.0, 46.0, 4318.0, 3745.0, 2197.0, 11329.0, 646.0, 9873.0, 9572.0] 355630144.0
So you can see when I call the Function with floating variables 100 times. It work and give the optimal parameters.
And also you can see when I call the Function with Integer variables 300 and 400 times. But it holds the value of parameters and gives the same Output. I expect it to be nearly Zero.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels