madeleineudell / parallelsparseregression.jl Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Start with a very high regularizer, so the problem is easy to solve, and decrease it. Each iteration should be very fast. Design make_prox_*
so that changing lambda incurs little overhead. Allow user to choose lambda_min and lambda_max, but also include good defaults to encourage interesting (eg non-zero) solutions.
This should be easy to do using cvxpy. In test/test.jl, just add
using PyCall
@pyimport cvxpy
to compute the solution using a verified method and compare the results.
When I run test/test.jl, I get the error:
ERROR: pids not defined
in make_prox_lsq at /Users/stevend2/.julia/ParallelSparseRegression/src/prox.jl:51
in nnlsq at /Users/stevend2/.julia/ParallelSparseRegression/src/regression.jl:6
in include_from_node1 at loading.jl:120
while loading /Users/stevend2/PythonProjects/ParallelSparseRegression.jl/test/test.jl, in expression starting on line 15
This also showed up when I was using ParallelSparseMatMul. How do I fix this?
Cannot run the tests after latest updates. (My system does not show a stack traceback, looking to replicate in one that does)
โ test git:(master) julia test.jl
ERROR: access to undefined reference
while loading /Users/x/.julia/ParallelSparseRegression/test/test.jl, in expression starting on line 15
@madeleineudell Thanks for this package, here is the output of my initial testing:
using ParallelSparseRegression
m,n,p = 2048,1024,.1
A = sprand(m,n,p)
x0 = Base.shmem_randn(n)
b = A*x0
rho = 1
lambda = 1
quiet = false
maxiters = 100
params = Params(rho,quiet,maxiters)
# Lasso
@time z_lasso = lasso(A,b,lambda; params=params)
Calling the following program with different addprocs values gives the following:
1000 : 1.76e+00 1.27e-01 5.54e-03 4.09e+01
elapsed time: 24.422318823 seconds (6440755392 bytes allocated)
1000 : 2.15e+00 1.12e-01 6.07e-03 4.65e+01
elapsed time: 90.979009048 seconds (12805856436 bytes allocated)
1000 : 1.75e+00 1.47e-01 5.74e-03 4.21e+01
elapsed time: 228.324713722 seconds (28927210844 bytes allocated)
m,n,p = 100,20,.1
A = sprand(m,n,p)
x0 = Base.shmem_randn(n)
b = A*x0
rho = 1
quiet = false
maxiters = 100
params = Params(rho,quiet,maxiters)
z = nnlsq(A,b; params=params)
Running the above file returns now:
ERROR: params not defined
Here is an example that could be added to the test suite, for my problem I need to send matrices instead of vectors to the lasso solver:
using ParallelSparseRegression
dimensions, components, samples = 180, 100, 1500
dictionary = sprandn(dimensions, components, 0.1)
original_code = sprandn(components, samples, 0.1)
data = dictionary * original_code
# minimize \|data - dictionary*code\|_2^2 + \lambda\|code\|_1
# for variable code.
code = lasso(data, dictionary, 1)
# FIXME(Ariel): Is this the best way to check it found the real solution?
@assert(code = original_code)
IterativeSolvers uses "maxiter", ParallelSparseRegression uses "maxiters". Should we harmonize the two to avoid confusion for end users?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.