HNHacker News
TopNewBestAskShowJobs

kwertzzz

153 karma · joined April 24, 2018

submissionscomments
kwertzzz··on Why I use R
Actually, for plotting I prefer to use PyPlot in Julia which is based on matplotlib which is very mature and complete in my opinion. I tried to use other (more native) plotting packages like GR, Plots and Makie but they did not provide all the plotting types I needed or where to rough around the edges.

In any case, I am looking forward to new julia versions which should address the delay in plotting (as far as I known).

kwertzzz··on Why I use R
The interoperability of Julia and Python is really good (Julia calling Python and vice-versa). There is also the possibility to call R functions (but I do not use it personally). To some degree, one can leverage python's ecosystem in Julia. Our group switched from matlab to Julia are we are quite happy with the move.

For teaching, I think that Julia indexing (for example: vector[2:end-1]) is easier to explain than numpy (vector[1:-1]). On the other hand, I like python's plain English operators and/or versus && / || in Julia.

Also loops tends to be more readable than vertorised code in some circumstances (e.g. computing the Laplacian by finite difference). In Julia, loop and vectorized code are both quite efficient, while in python and R, one has to vectorize the code.

kwertzzz··on Deep learning may need a new programming language
Julia fits the bill quite well in my opinion:

* features: you have an extensive standard library, macros, high level constructs (like generators, asynchronous programming, ...)

* performance: julia is based on LLVM and as long the code is type-stable and avoids memory allocation in hot loops, the performance is similar to C or Fortran.

* usability: you can also program at a very high level like you would do in matlab or python/numpy.

kwertzzz··on Compiling Julia to TPUs [pdf]
OK, I see. In any case, even if the performance would not match Tensforflow on TPU this is a major achievement. After all, Google made the TPUs specifically for Tensorflow. I would not have imagined that it was so "easy" to replace LLVM by XLA.
kwertzzz··on Compiling Julia to TPUs [pdf]
This is a very impressive work. I am wondering why it was compared against PyTorch (just on the CPU) and not against Tensorflow (on CPU and TPU) or do I miss something?
kwertzzz··on Parallel Supercomputing for Astronomy with Julia
This is really a great achievement. I am wondering how much communication was necessary between the cores during the computation or is the problem a so called "embarrassingly parallel" workload where the work could be split into independent tasks?
kwertzzz··on Julia 1.0
This is indeed a very good idea. In Julia, the package author defines the range of supported Julia version. Most package actually just say "version 0.6 or later". The JuliaDB package was just been updated preventing the installation on Julia 0.7 or 1.0:

https://github.com/JuliaComputing/JuliaDB.jl/commit/8bf3057d...

A automatic check as in R would indeed a better choice.

kwertzzz··on Pythran: Crossing the Python Frontier [pdf]
Sorry for the delay, but here is an example code:

https://gist.github.com/Alexander-Barth/c8eb764f400cdb7a1eb5...

Do not hesitate to tell me if I missed something to optimize the python code. If somebody has numba, pythan,... installed, I would be interested to see the speed-up compared to the vanilla python version on your machine.

So in short, for my cases: the fastest Julia test case (with loops and avoiding unnecessary allocation) was about 10x faster than fastest python 3 test case (with vectorization).

The runtime with vectorization are relatively similar (julia is only about 25% faster than python). Explicit loop and careful memory management are clearly beneficial in Julia.

kwertzzz··on Pythran: Crossing the Python Frontier [pdf]
Thank you for the info about numpy.matmul. However this feels quite clumsy to use a function call for a matrix operator, especially when you have several chained. I think that this is an good move to get rid of matrix class (I just didn't find any depreciation info in the documentation, maybe this still needs some time).

I think the python language is very elegant and the principle that there should be only one obvious way to do something has served them quite well. Unfortunately, in numpy you have quite often multiple ways to do things (often in addition to python own mechanism, e.g sum, numpy.sum and the sum method). I deal with students who have little programming experience and this can be confusing. One of the reasons I choose Julia for my lectures was that these issues do not exist in Julia. Julia is quite clean and simple in this regard.

However I completely see that for an experienced programmer (or a scientist with good programming experience), this is not a problem.

But for somebody learning to solve numerical problems, it is quite helpful that Julia code tends to be closer to the mathematical formulation. In addition, for the test I made, Julia code tends to be faster than vectorized numpy code (I can share the code if there is interest). The only major argument against Julia, in my opinion, is that it is still a young language and with a small ecosystem (much smaller in fact than python or R)

kwertzzz··on Pythran: Crossing the Python Frontier [pdf]
I am giving a class on numerical methods and one student choose to use python (while my example code was in Julia). It was a pain to see how this student was constantly shooting himself in the foot due some particular behaviors of python and numpy. For instance the student did not expect that a list comprehension iterating over a numpy vector returns just a python vector. Also the fact that the index ranges the last value is excluded let to several bugs. The exercise involved a time dependent matrix and the student choosed to represent it as a 3d Array, but then he needed to constantly convert slices as a matrix to use matrix multiplication (maybe this is now better solved with python 3 and the @ operator). So in short for doing linear algebra, Julia is really more convenient to use.
← PreviousPage 3 of 3