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
I am running the example given in the docs.
As I change the value of lambda the doc seems to imply that we get different results; but we do not.
What is the best way to solve this problem for different values of lambda?
using lambda=Variable(); fix!(lambda, 9)?
n =9
y =1:n
x =Variable(n)
lambda =1
problem =minimize(sumsquares(y - x) + lambda *sumsquares(x -10))
@timesolve!(problem)
@show x.value # Expected = 5.5:.5:9.5
lambda =9@timesolve!(problem, warmstart=true)
@show x.value # Expected = 9.1:.1:9.9
The text was updated successfully, but these errors were encountered:
Yes, I believe you should use fix!, and I made a pull request to change the docs to this effect; changing lambda as the docs suggest after the problem is constructed does not change the problem at all (in fact, since minimize is not a macro, I think it would be impossible for that to happen).
Note to use fix! you would need lambda = Variable(Positive()) because Convex does not update the sign automatically when using fix! (maybe this should be added?). You could also do
I am running the example given in the docs.
As I change the value of lambda the doc seems to imply that we get different results; but we do not.
What is the best way to solve this problem for different values of lambda?
using
lambda=Variable(); fix!(lambda, 9)
?The text was updated successfully, but these errors were encountered: