Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Elliot Saba
Since we have made sure that our for loops have the right boundaries, we can assure the compiler that we're not going to step out of the bounds of an array, and surround our code in the @inbounds macro. This is not something you should do unless you're certain that you'll never try to access memor

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Freddy Chua
wooh, this @inbounds thing is new to me... At least it does shows that Julia is comparable to Java. On Sunday, April 27, 2014 3:04:26 PM UTC+8, Elliot Saba wrote: > > Since we have made sure that our for loops have the right boundaries, we > can assure the compiler that we're not going to step o

[julia-users] Why are Filtered Iterators slow?

2014-04-27 Thread Spencer Liang
Sometimes when I have a collection, I would like to be able to iterate over all but a few elements. It seems like the best way to do this in a functional style is to filter the original iterator. Looking at the code in base/iterator.jl, it appears that this should be efficient. However, this do

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Elliot Saba
I highly suggest you read through the whole "Performance Tips" page I linked to above; it has documentation on all these little features and stuff. I did get a small improvement (~5%) by enabling SIMD extensions on the two inner for

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Freddy Chua
Alright, thanks! All these is looking very positive for Julia. On Sunday, April 27, 2014 3:36:23 PM UTC+8, Elliot Saba wrote: > > I highly suggest you read through the whole "Performance > Tips" > page I linked to above; it has doc

[julia-users] A Reader for the Harwell-Boeing Format

2014-04-27 Thread Dominique Orban
Here's a reader for matrices and supplementary data written in the Harwell-Boeing format: https://github.com/dpo/rb.jl The Harwell-Boeing format is the predecessor of the Rutherford-Boeing format, which is the format used by the University of Florida Sparse Matrix Collection. There's quite a bi

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Carlos Becker
I agree with Elliot, take a look at the performance tips. Also, you may want to move the tic(), toc() out of the function, make sure you compile it first, and then use @time to time it. you may also get a considerable boost by using @simd in your for loops (together with @inbounds) Let us know

Re: [julia-users] Why are Filtered Iterators slow?

2014-04-27 Thread Tim Holy
First, nice job paying attention to the memory allocation. Many people seem not to notice this, but it's critical to analyzing performance problems. When you have questions like this, one nice tool is ProfileView, which can help you identify the line(s) that are triggering garbage collection (wh

Re: [julia-users] A Reader for the Harwell-Boeing Format

2014-04-27 Thread Tim Holy
Nice! To make it easy for others to use, consider registering this as a package. Instructions are here: http://docs.julialang.org/en/latest/manual/packages/#package-development Best, --Tim On Sunday, April 27, 2014 01:11:32 AM Dominique Orban wrote: > Here's a reader for matrices and supplement

[julia-users] Re: A Reader for the Harwell-Boeing Format

2014-04-27 Thread Tony Kelman
We're not turning it into a shared library at present, but we are already building librbio.a under deps/SuiteSparse-4.2.1/RBio/Lib I bet with a few additional lines here https://github.com/JuliaLang/julia/blob/master/deps/Makefile#L1239-L1247 you could leverage that to save some time? Pure-Juli

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Iain Dunning
I'm very surprised that Java is that much faster than the initial implementation provided (after its been wrapped in a function). Feel like there is something non-obvious going on... On Sunday, April 27, 2014 5:33:06 AM UTC-4, Carlos Becker wrote: > > I agree with Elliot, take a look at the perf

[julia-users] Re: Bindling a command line utility with a package

2014-04-27 Thread andrew cooke
Just to follow-up on this. The simplest way to bundle a command line utility with a package seems to be: - use ArgeParse as normal and define a main(ARGS) function - export the main() function from the package - tell the user to call or alias julia -e "using PKG; main(ARGS)" This works because

[julia-users] Re: A Reader for the Harwell-Boeing Format

2014-04-27 Thread Miles Lubin
Very useful, thanks! I agree with Tim's suggestion that this deserves to be registered as a package. Note that there's already a package for MatrixMarket format: https://github.com/ViralBShah/MatrixMarket.jl. On Sunday, April 27, 2014 4:11:32 AM UTC-4, Dominique Orban wrote: > > Here's a reader

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Freddy Chua
You are mistaken. The improvement is in the Julia implementation. On Sunday, April 27, 2014 11:13:12 PM UTC+8, Iain Dunning wrote: > > I'm very surprised that Java is that much faster than the initial > implementation provided (after its been wrapped in a function). Feel like > there is somethin

[julia-users] Re: Non-fatal error messages from Base.Test

2014-04-27 Thread Iain Dunning
You should look at one of the many testing packages that are out there for further inspiration: https://groups.google.com/forum/#!searchin/julia-users/testing$20packages/julia-users/fSLuCXpk_1M/wkDLA-ZfOQYJ On Saturday, April 26, 2014 9:49:06 AM UTC-4, Tomas Lycken wrote: > > In many situations

[julia-users] Re: List of testing packages to date

2014-04-27 Thread Iain Dunning
Also: https://github.com/arypurnomoz/JulieTest.jl On Tuesday, February 25, 2014 5:14:42 PM UTC-5, andrew cooke wrote: > > > > On Tuesday, 25 February 2014 00:53:57 UTC-3, Iain Dunning wrote: >> >> UnitTest.jl >> >>- Unlisted >> - https://github.com/analyzere/UnitTest.jl >> - Writes

[julia-users] REQUIRE Julia Version

2014-04-27 Thread andrew cooke
How do I specify that my package only works with Julia 0.3 onwards in the REQUIRE file? http://julia.readthedocs.org/en/latest/manual/packages/ explains that VERSION can be used "in runtime checks", but doesn't explain how to constrain julia (rather than some other package) or what these "runt

Re: [julia-users] REQUIRE Julia Version

2014-04-27 Thread John Myles White
In the requires file, you add a line like julia 0.3- to indicate that Julia 0.3 prerelease or later is required. -- John On Apr 27, 2014, at 11:55 AM, andrew cooke wrote: > > How do I specify that my package only works with Julia 0.3 onwards in the > REQUIRE file? > > http://julia.readthe

Re: [julia-users] REQUIRE Julia Version

2014-04-27 Thread andrew cooke
thanks. apparently i also need an SHA-1 hash. see https://github.com/JuliaLang/METADATA.jl/pull/796 - does that go on the same line? On Sunday, 27 April 2014 12:05:45 UTC-4, John Myles White wrote: > > In the requires file, you add a line like > > julia 0.3- > > to indicate that Julia 0.3 pr

Re: [julia-users] REQUIRE Julia Version

2014-04-27 Thread andrew cooke
Looking at other packages, the version seems to be something in a separate file that (I guess) is automatically added by tagging. I will tag a release and see what happens. On Sunday, 27 April 2014 12:09:16 UTC-4, andrew cooke wrote: > > thanks. apparently i also need an SHA-1 hash. see > h

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Jason Merrill
On Sunday, April 27, 2014 12:04:26 AM UTC-7, Elliot Saba wrote: > > Since we have made sure that our for loops have the right boundaries, we > can assure the compiler that we're not going to step out of the bounds of > an array, and surround our code in the @inbounds macro. This is not > someth

Re: [julia-users] REQUIRE Julia Version

2014-04-27 Thread andrew cooke
Yes, tagging (ie Pkg.tag(MyPkg)) creates the sha1 file. On Sunday, 27 April 2014 12:17:19 UTC-4, andrew cooke wrote: > > > Looking at other packages, the version seems to be something in a separate > file that (I guess) is automatically added by tagging. I will tag a > release and see what hap

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Freddy Chua
yep, x never changes... On Monday, April 28, 2014 12:25:14 AM UTC+8, Jason Merrill wrote: > > On Sunday, April 27, 2014 12:04:26 AM UTC-7, Elliot Saba wrote: >> >> Since we have made sure that our for loops have the right boundaries, we >> can assure the compiler that we're not going to step out

[julia-users] Octave diag and Julia diag

2014-04-27 Thread John Code
Hi all, I would like to ask why there is a difference between Octave diag function and the function that julia provide. For example, in the following Octave session I get: octave:1> v = [1 2 3 4] v = 1 2 3 4 octave:2> a = diag(v) a = Diagonal Matrix 1

[julia-users] Sparse hermitian matrix?

2014-04-27 Thread Dominique Orban
(I hope this isn't a RTFM. I saw something in the manual about hermitian matrices related to Lapack, so it only seemed to be dense.) Is there provision for hermitian *sparse* matrices in Julia, in the sense that if A is "declared" hermitian, only its lower (or upper) triangle is stored and A*x

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread Andreas Noack Jensen
Hi John In julia, the function diag extract the diagonal of a matrix and if the matrix is rectangular, it extracts the diagonal of the largest square sub matrix. Note that in julia, [1 2 3 4] is not vector but a matrix. To construct a matrix from a vector you can either use the function diagm, whi

Re: [julia-users] Sparse hermitian matrix?

2014-04-27 Thread Andreas Noack Jensen
This is not possible right now, but it is on my todo list to generalise the Hermitian type to allow e.g. sparse matrices. 2014-04-27 21:42 GMT+02:00 Dominique Orban : > (I hope this isn't a RTFM. I saw something in the manual about hermitian > matrices related to Lapack, so it only seemed to be

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread John Code
Thank you. On Sunday, April 27, 2014 11:49:12 PM UTC+4, Andreas Noack Jensen wrote: > > Hi John > > In julia, the function diag extract the diagonal of a matrix and if the > matrix is rectangular, it extracts the diagonal of the largest square sub > matrix. Note that in julia, [1 2 3 4] is not v

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread Ivar Nesje
This difference should be explained in the documentation for diag The current documentation is kind of short: Base.diag(M[, k]) The "k"-th diagonal of a matrix, as a vector. Ivar kl. 21:54:43 UTC+2 søndag 27. april 2014 skrev John Code følgende: > > Thank you. > > On Sunday, April 27, 2014

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread Andreas Noack Jensen
I agree. It would probably avoid some confusion if the documentation was a little longer and pointed to diagm and Diagonal. 2014-04-27 22:02 GMT+02:00 Ivar Nesje : > This difference should be explained in the documentation for diag > > The current documentation is kind of short: > > Base.diag(M[

Re: [julia-users] Sparse hermitian matrix?

2014-04-27 Thread Tony Kelman
Some of this functionality might be available by accessing CHOLMOD types and functions, but they aren't fully exported, documented, etc. Last time I tried to use these it looked like there were some memory leaks as well. On Sunday, April 27, 2014 12:50:47 PM UTC-7, Andreas Noack Jensen wrote: >

[julia-users] Re: A Reader for the Harwell-Boeing Format

2014-04-27 Thread Dominique Orban
Thanks a lot all for the feedback. There should now be a (yet unregistered) module named "rb". It may not be the best name (it stands for "Rutherford-Boeing"). As this is my first module, I'd appreciate any feedback. Also I'm sure there are places where the code could be more efficient. Tony,

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread Simon Kornblith
If diag is passed a vector rather than a matrix, we already give a good error message: julia> diag([1, 2, 3, 4]) ERROR: use diagm instead of diag to construct a diagonal matrix in diag at linalg/generic.jl:49 It wouldn't hurt to have this in the docs, though. On Sunday, April 27, 2014 4:07:52

[julia-users] Re: A Reader for the Harwell-Boeing Format

2014-04-27 Thread Miles Lubin
On Sunday, April 27, 2014 5:34:56 PM UTC-4, Dominique Orban wrote: > > Thanks a lot all for the feedback. There should now be a (yet > unregistered) module named "rb". It may not be the best name (it stands for > "Rutherford-Boeing"). As this is my first module, I'd appreciate any > feedback. Al

[julia-users] do block semantics

2014-04-27 Thread Peter Simon
In the Julia manual, the second example in block-syntax-for-function-arguments contains the following do block: open("outfile", "w") do f write(f, data) end and the documentation states t

Re: [julia-users] do block semantics

2014-04-27 Thread Amit Murthy
Without using a do-block, you would need to pass in a function as the first argument to 'map'. 'open' has a variant where the first argument is again a function that accepts an open handle. The do-block syntax in this case just allows you to define the said function. On Mon, Apr 28, 2014 at 8:55

Re: [julia-users] do block semantics

2014-04-27 Thread Peter Simon
My question concerns where this handle comes from. Isn't the handle coming from the output of 'open'? Since 'open' is the "outer" function of the 'do' construct, then why doesn't the outer function in the first example also supply its output as input to its inner function? On Sunday, April 27

Re: [julia-users] do block semantics

2014-04-27 Thread Amit Murthy
It is just a way to define an anonymous function. It is not a way to define an "inner" function in that sense. On Mon, Apr 28, 2014 at 9:24 AM, Peter Simon wrote: > My question concerns where this handle comes from. Isn't the handle > coming from the output of 'open'? Since 'open' is the "out

Re: [julia-users] do block semantics

2014-04-27 Thread Peter Simon
Right, I don't have a problem with that. I simply used "inner" as a way to refer to the function that is used as the first argument to the other ("outer") function. Sorry if I abused a conventional meaning of these terms. I would like to know how this anonymous function (in the "open" example

Re: [julia-users] do block semantics

2014-04-27 Thread Amit Murthy
The actual function as defined in base/io.jl function open(f::Function, args...) io = open(args...) try f(io) finally close(io) end end Just multiple dispatch at work. The 'open' variant without a file handle is called first. On Mon, Apr 28, 2014 at 9:44 AM, Pet

[julia-users] Re: JuliaGPU organization

2014-04-27 Thread Krzysztof Kamieniecki
Thanks. I just spent a week filling a physical dumpster. Now maybe I should focus on some software house cleaning :) On Wednesday, April 23, 2014 12:34:02 AM UTC-4, Jake Bolewski wrote: > > I added you as a member so it should be easy to transfer ownership of the > repository. I also recently m

Re: [julia-users] do block semantics

2014-04-27 Thread Peter Simon
Ah, you just switched on the light for me. I thought that the example was illustrating a general principle, but in fact the essential feature depends on knowledge of the way that the 'open' method is coded. Thanks! On Apr 27, 2014 9:24 PM, "Amit Murthy" wrote: > The actual function as defined i

Re: [julia-users] do block semantics

2014-04-27 Thread Ivar Nesje
Yes, the do block is just pretty syntax for creating an anonymous function and passing it as the first argument. How and if the (inner) function is invoked is decided by the (outer) function.

Re: [julia-users] do block semantics

2014-04-27 Thread Peter Simon
Going back and rereading the 'open' documentation, it clearly states that the method taking a function as its first argument will apply that function to the file handle returned by the method without the handle. Thanks for your patience. On Apr 27, 2014 9:41 PM, "Peter Simon" wrote: > Ah, you

Re: [julia-users] do block semantics

2014-04-27 Thread Ivar Nesje
Also, if you are curious about what method gets invoked, you can use the @which macro, to display the signature, file and line of the method definition. @which open("file.text","w") do f write(f, "Hello world!") end In the 0.3 prereleases you might also use the @less macro to see the code

Re: [julia-users] Octave diag and Julia diag

2014-04-27 Thread Viral Shah
I filed https://github.com/JuliaLang/julia/issues/6676 -viral On Monday, April 28, 2014 4:04:33 AM UTC+5:30, Simon Kornblith wrote: > > If diag is passed a vector rather than a matrix, we already give a good > error message: > > julia> diag([1, 2, 3, 4]) > ERROR: use diagm instead of diag to con

[julia-users] Re: A Reader for the Harwell-Boeing Format

2014-04-27 Thread Dominique Orban
Done, thanks. On Sunday, April 27, 2014 6:14:49 PM UTC-7, Miles Lubin wrote: > > On Sunday, April 27, 2014 5:34:56 PM UTC-4, Dominique Orban wrote: >> >> Thanks a lot all for the feedback. There should now be a (yet >> unregistered) module named "rb". It may not be the best name (it stands for >