I use from scipy for minimization. Variable must to be 0 or 1. How can I do this?
Asked
Active
Viewed 39 times
-1
-
It's not supported (and the question is too broad to recommend alternatives). – sascha Mar 12 '18 at 11:37
1 Answers
-2
I find the solution with add the constraint.
cons = ({'type':'eq'
,'fun': lambda x_f : np.array([(x_f[:x_ini_size][i]-int(x_f[:x_ini_size][i]))
for i in sentences_idx])})
![](../../users/profiles/2742177.webp)
zed khaleghi
- 29
- 4