-
Notifications
You must be signed in to change notification settings - Fork 24
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
Nonnegative least squares example #119
Comments
Just took a quick look, looks like a reasonable example, not sure what we currently have. If we want to illustrate optimized code we there are a few possible optimizations like allocating a temp variable and We might not care about optimizing the code though, and in that case i think the temp variable and normdiff can be skipped. Edit: the cost printed doesn't seem to correspond to the algoritm. |
yea forgot to delete/edit the cost printout. So the stuff I've read typically denotes Feel free to change it up, use it, don't use it :). I just wrote it real quick while trying something much more involved and trying to learn the package :). Figured I'd offer it because it's a nice compliment to the LASSO example. |
Probably better to use an underdetermined example to show efficacy... m, n, k, sig = 200, 300, 100, 1e-3
A = randn(m, n)
x_true = randn(n)
b = A*x_true
x_admm = admm(A, b, zeros(n))
x_ls = inv(A'A)*A'*b
pos(x) = (x > 0.0) ? x : 0.0
sum(abs, x_admm .- x_true)
sum(abs, x_ls .- x_true)
sum(abs, pos.(x_ls) .- x_true)
|
Whipped this together earlier. Not sure on the stopping criterion, but it seems reasonable...
The text was updated successfully, but these errors were encountered: