Skip to content
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

why julia but not pytorch? #16

Open
zhaoguangyuan123 opened this issue May 1, 2023 · 4 comments
Open

why julia but not pytorch? #16

zhaoguangyuan123 opened this issue May 1, 2023 · 4 comments

Comments

@zhaoguangyuan123
Copy link

Hi Ptylab team,

Interesting project.

Could you pls tell me why you chose Julia but not Pytorch as the base language?

Best,
Guangyuan

@roflmaostc
Copy link
Member

Hi,
in case you missed it, there is also a Python (NumPy and CuPY based) and a Matlab implementation!
PtyLab

But in general, Julia offers the same features as PyTorch, actually quite a bit more such as native JIT compilation of the whole code (which was just recently added in PyTorch).

So yes, a rewrite in PyTorch would be possible too but there is no reason why PtyLab should be faster or easier to implement in PyTorch.

And the Python version uses CUDA too and one of the heavy operations are FFTs which are effectively the same in PyTorch, Julia, Jax, CuPy, ...

@zhaoguangyuan123
Copy link
Author

I see. Thanks, Felix.

I asked that questions as I wondered which should be the base language when open-source resources in computational imaging/optics.

Currently, there are many choices: pytorch/julia/jax etc.
Connecting tools from one source to another might not be easy task if they are from different languages.

Best,
Guangyuan

@roflmaostc
Copy link
Member

roflmaostc commented May 1, 2023

There is no "perfect" language, it depends on your needs, I would say.
Also it might change with time. A decade ago, Matlab was way more popular. In the 80s it was Fortran.

I would recommend to stick with the one you are most proficient and convenient with. In my case it's Julia but I also use PyTorch daily.
As a researcher, it's more about the conceptual ideas which can be realized in all languages at the end of the day.

However, if you need heavy ML tasks PyTorch and TensorFlow might be the best options currently because of their huge user base and the thousands examples.
But then you're just among many other mainstream people 😄

@zhaoguangyuan123
Copy link
Author

Sure. Like your last sentence most 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants