-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow error when find the value of deeply nested nonlinear expressions #3884
Comments
Issue is the use of recursion in Lines 694 to 722 in 7111683
|
So, taking another look, it's true that we use recursion in If you don't want to use using JuMP
N = 8_000
model = Model()
@variable(model, x[1:N], start = 0)
f = prod(sum(x[1:i]) for i in 1:N)
flatten!(f)
value(start_value, f) This is such a rare case that can be easily worked around that I don't know if it's worth complicating the implementation of |
The other option is of course: @variable(M, x[1:N], start = 0)
y = value.(start_value, x)
prod(sum(y[1:i]) for i in 1:N) |
This is my solution, find the value first.
I see this as more of a documentation issue, of which this thread may be
sufficient. I didn't get any hits useful hits when I googled it. I'm in a
position where I know how to fix the issue, but I could see future users
getting confused.
…On Sun, Nov 17, 2024, 3:14 PM Oscar Dowson ***@***.***> wrote:
The other option is of course:
@variable(M, x[1:N], start = 0)
y = value.(start_value, x)prod(sum(y[1:i]) for i in 1:N)
—
Reply to this email directly, view it on GitHub
<#3884 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVAPXPQWFXHA34JP6UK64D2BEBNDAVCNFSM6AAAAABR3ZEU5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBRGU3TQNZUGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't even know if it is a documentation issue. Let's work through what this line is doing: value(start_value,prod(sum(x[1:i]) for i in 1:N))
We then call The alternative is to compute Also how sparse is the start value of |
Will be fixed by #3889 |
As the title says, finding the value of a deeply nested nonlinear expression causes a stack overflow error. I've minimized the value of
N
on my machine.MWE:
This is not urgent on my end, I moved the value inside the product. I am also refactoring my code to not have this issue.
The text was updated successfully, but these errors were encountered: