You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\software\anconda\lib\site-packages\sko\GA.py", line 57, in
penalty_ueq = np.array([np.sum(np.abs([max(0, c_i(x)) for c_i in self.constraint_ueq])) for x in self.X])
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The text was updated successfully, but these errors were encountered:
After some investigation, I've highlighted that the issue arises after the first iteration: while I haven't cloned the code to debug it yet (If maintainers would appreciate a fix and pull request on this then I could do so), it seems that in the first iteration it works properly, self.need_update is size (pop_size, 1) array, but in the second iteration it returns (pop_size, pop_size) arrray of booleans. Looks like it is because self.pbest_y is a 2-dimensional array with shape (pop_size, 1) but self.Y is a 1-dimensional array of length pop_size, so effectively shape (1, pop_size) I think. It's a quick fix in the definition of self.Y but I do now notice that this is a bug inherently different from the one in this thread, so I will open a new one.
File "C:\software\anconda\lib\site-packages\sko\GA.py", line 57, in
penalty_ueq = np.array([np.sum(np.abs([max(0, c_i(x)) for c_i in self.constraint_ueq])) for x in self.X])
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The text was updated successfully, but these errors were encountered: