Julia thread

This is 100% #JuliaLang code. It trains a dense neural network using the #Keras Python library. If you replace the first 3 lines with "import tensorflow as tf; from tensorflow import keras", you can run the exact same code in Python. Talk about excellent interoperability!
Handshake
5:19 AM · Jun 30, 2020Twitter Web App
Replying to
Such an interesting call! I mean, how useful is to try this tool enhancing the speed by using Julia. I would like to know if JuliaML.jl gives or not a better result than you presented?
Good question! This example just shows that you can use any Python library in Julia. This makes it easier to transition from Python to Julia.
1
7
Pure Julia code is 10x to 100x faster than pure Python code, in most cases. It can even be faster than Python C modules, like NumPy, in some cases. For example sin.(cos.(exp.(A))) in Julia will iterate over the array A just once, whereas NumPy would create 2 temporary arrays.
I haven't run any benchmarks on this, but I assume that everything that interacts with Python runs at Python speed, plus a small overhead due to the conversion. But that overhead is small as Python runs in the Julia process itself. The benefit is interoperability, not speed.
1
3
Yes, you could do that. However, in the long term Julia solves the two-language problem, where you need one language for high level stuff and another for low level. With Julia, you can write high level code and it will run fast.

Comments

Popular posts from this blog

Easy Text-to-Speech with Python

Flutter for Single-Page Scrollable Websites with Navigator 2.0

Better File Storage in Oracle Cloud