Re: [SciPy-User] A priority of constrains for scipy.optimize.minimize
Change your loss function to a penalized form. IE: Instead of minimizing L(x) s.t. f_1(x) (necessary constraint) f_2(x) (nice but not necessary constraint) .... Do this instead: Minimize L(x) + \lambda * f_2(x) s.t. f_1(x) where \lambda can be a hyper parameter you can tune to trade off how important constraint f_2 is relative to loss function quality. Alternatively: if you are doing minimization on a probability simplex, you can probably re-parametrize your problem so the only viable solution automatically satisfies those probabilities. The most common way is to run your output through a softmax ( https://en.wikipedia.org/wiki/Softmax_function) On Tue, Feb 5, 2019 at 9:06 AM <scipy-user-request@python.org> wrote:
Send SciPy-User mailing list submissions to scipy-user@python.org
To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/scipy-user or, via email, send a message with subject or body 'help' to scipy-user-request@python.org
You can reach the person managing the list at scipy-user-owner@python.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of SciPy-User digest..."
Today's Topics:
1. A priority of constrains for scipy.optimize.minimize (Jan Hendrik Berlin)
----------------------------------------------------------------------
Message: 1 Date: Tue, 5 Feb 2019 02:07:35 +0100 From: Jan Hendrik Berlin <jan-hendrik.berlin@cs.uni-dortmund.de> To: SciPy-User <scipy-user@python.org> Subject: [SciPy-User] A priority of constrains for scipy.optimize.minimize Message-ID: <3953ef2d-0660-8fe6-7e04-45b8f2c2735a@cs.uni-dortmund.de> Content-Type: text/plain; charset=utf-8; format=flowed
Hi,
I am solving a problem with some constrains. At first there is a constraint, that the sum of the percentages must be 1. The single percentage could be in the range from 0,0 to 1. And this is the main constraint. On the other side there are some constrains belonging to stuff of the calculation. It is possible, that this constrains are to strong and the solver can't get a solution. In this Case I want to have an option to get a solution respecting the first constraint.
Has anybody an idea of a solution? I think there is no option for a priority of the constrains.
kind regards Jan Hendrik Berlin
------------------------------
Subject: Digest Footer
_______________________________________________ SciPy-User mailing list SciPy-User@python.org https://mail.python.org/mailman/listinfo/scipy-user
------------------------------
End of SciPy-User Digest, Vol 186, Issue 2 ******************************************
participants (1)
-
federico vaggi