[SciPy-User] A bug in SLSQP?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] A bug in SLSQP?

Yuxiang Wang
Dear all,

In using scipy.optimize.minimize, I encountered a bug when using bounds.

My bounds is set as: bounds = ((0, None), (0, None), (0, 1), (0, None))

Then, it will say invalid value encountered in greater bnderr =
where(bnds[:, 0] > bnds[:, 1])[0]

I looked into slsqp.py, and in line 330, it checks: if bounds is None
or len(bounds) == 0: ...

Obviously, bounds is not None, so it did not replace 1e12 or -1e12
into the bnds.


Could anyone please help? Thanks!

My scipy version: 0.15.1; numpy version: 1.9.2. I am using Windows 64
bit, Python 3.4.

Shawn

--
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
[hidden email]
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: A bug in SLSQP?

Yuxiang Wang
Dear all,

Oops - sorry. Please disregard my previous email. Even though it
complains (the warning), it still filled the xl and xu with the right
values.

Sorry again for the spamming.

Shawn

On Tue, May 5, 2015 at 1:41 PM, Yuxiang Wang <[hidden email]> wrote:

> Dear all,
>
> In using scipy.optimize.minimize, I encountered a bug when using bounds.
>
> My bounds is set as: bounds = ((0, None), (0, None), (0, 1), (0, None))
>
> Then, it will say invalid value encountered in greater bnderr =
> where(bnds[:, 0] > bnds[:, 1])[0]
>
> I looked into slsqp.py, and in line 330, it checks: if bounds is None
> or len(bounds) == 0: ...
>
> Obviously, bounds is not None, so it did not replace 1e12 or -1e12
> into the bnds.
>
>
> Could anyone please help? Thanks!
>
> My scipy version: 0.15.1; numpy version: 1.9.2. I am using Windows 64
> bit, Python 3.4.
>
> Shawn
>
> --
> Yuxiang "Shawn" Wang
> Gerling Research Lab
> University of Virginia
> [hidden email]
> +1 (434) 284-0836
> https://sites.google.com/a/virginia.edu/yw5aj/



--
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
[hidden email]
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: A bug in SLSQP?

ralfgommers


On Tue, May 5, 2015 at 8:08 PM, Yuxiang Wang <[hidden email]> wrote:
Dear all,

Oops - sorry. Please disregard my previous email. Even though it
complains (the warning), it still filled the xl and xu with the right
values.

Sorry again for the spamming.

Thanks for the quick update. Looks to me like there's something to fix though. Your bounds are specified correctly, so there shouldn't be a warning like that. Can you provide a self-contained example that reproduces the warning and open an issue?

Ralf

 

Shawn

On Tue, May 5, 2015 at 1:41 PM, Yuxiang Wang <[hidden email]> wrote:
> Dear all,
>
> In using scipy.optimize.minimize, I encountered a bug when using bounds.
>
> My bounds is set as: bounds = ((0, None), (0, None), (0, 1), (0, None))
>
> Then, it will say invalid value encountered in greater bnderr =
> where(bnds[:, 0] > bnds[:, 1])[0]
>
> I looked into slsqp.py, and in line 330, it checks: if bounds is None
> or len(bounds) == 0: ...
>
> Obviously, bounds is not None, so it did not replace 1e12 or -1e12
> into the bnds.
>
>
> Could anyone please help? Thanks!
>
> My scipy version: 0.15.1; numpy version: 1.9.2. I am using Windows 64
> bit, Python 3.4.
>
> Shawn
>
> --
> Yuxiang "Shawn" Wang
> Gerling Research Lab
> University of Virginia
> [hidden email]
> <a href="tel:%2B1%20%28434%29%20284-0836" value="+14342840836">+1 (434) 284-0836
> https://sites.google.com/a/virginia.edu/yw5aj/



--
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
[hidden email]
<a href="tel:%2B1%20%28434%29%20284-0836" value="+14342840836">+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user


_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: A bug in SLSQP?

Yuxiang Wang
Hi Ralf,

Thanks for your response! And - yes, sure thing.

Link to the issue:
https://github.com/scipy/scipy/issues/4811

Shawn

On Tue, May 5, 2015 at 2:20 PM, Ralf Gommers <[hidden email]> wrote:

>
>
> On Tue, May 5, 2015 at 8:08 PM, Yuxiang Wang <[hidden email]> wrote:
>>
>> Dear all,
>>
>> Oops - sorry. Please disregard my previous email. Even though it
>> complains (the warning), it still filled the xl and xu with the right
>> values.
>>
>> Sorry again for the spamming.
>
>
> Thanks for the quick update. Looks to me like there's something to fix
> though. Your bounds are specified correctly, so there shouldn't be a warning
> like that. Can you provide a self-contained example that reproduces the
> warning and open an issue?
>
> Ralf
>
>
>>
>>
>> Shawn
>>
>> On Tue, May 5, 2015 at 1:41 PM, Yuxiang Wang <[hidden email]> wrote:
>> > Dear all,
>> >
>> > In using scipy.optimize.minimize, I encountered a bug when using bounds.
>> >
>> > My bounds is set as: bounds = ((0, None), (0, None), (0, 1), (0, None))
>> >
>> > Then, it will say invalid value encountered in greater bnderr =
>> > where(bnds[:, 0] > bnds[:, 1])[0]
>> >
>> > I looked into slsqp.py, and in line 330, it checks: if bounds is None
>> > or len(bounds) == 0: ...
>> >
>> > Obviously, bounds is not None, so it did not replace 1e12 or -1e12
>> > into the bnds.
>> >
>> >
>> > Could anyone please help? Thanks!
>> >
>> > My scipy version: 0.15.1; numpy version: 1.9.2. I am using Windows 64
>> > bit, Python 3.4.
>> >
>> > Shawn
>> >
>> > --
>> > Yuxiang "Shawn" Wang
>> > Gerling Research Lab
>> > University of Virginia
>> > [hidden email]
>> > +1 (434) 284-0836
>> > https://sites.google.com/a/virginia.edu/yw5aj/
>>
>>
>>
>> --
>> Yuxiang "Shawn" Wang
>> Gerling Research Lab
>> University of Virginia
>> [hidden email]
>> +1 (434) 284-0836
>> https://sites.google.com/a/virginia.edu/yw5aj/
>> _______________________________________________
>> SciPy-User mailing list
>> [hidden email]
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> _______________________________________________
> SciPy-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



--
Yuxiang "Shawn" Wang
Gerling Research Lab
University of Virginia
[hidden email]
+1 (434) 284-0836
https://sites.google.com/a/virginia.edu/yw5aj/
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user