News for hackers. Stuff that matters.
Re:PyTorch vs. TensorFlow in 2022 by SleekEagle on Tuesday December 14, 2021 @12:00PM (#29553987)
Wow that's a really cool resource. Thanks for linking!

Even still, do you think researchers will want to take the time to learn all of that when PyTorch gives them no real reason to switch? Every day spent learning JAX is another day spent not reviewing literature, writing papers, or developing new models.

Re:PyTorch vs. TensorFlow in 2022 by fault1 on Tuesday December 14, 2021 @12:30PM (#29554404)
It depends on what you want to do obviously.

pytorch historically hasn't really focused on forward mode auto differentiation: https://github.com/pytorch/pytorch/issues/10223

this definitely limits its generality relative to jax, which makes it less than ideal for anything other than 'typical' deep neural networks

this is especially true when the research in question is related to things like physics or combining physical models and machine learning, which imho is very interesting. those are use cases that pytorch just isn't good at.

Re:PyTorch vs. TensorFlow in 2022 by SleekEagle on Tuesday December 14, 2021 @12:43PM (#29554593)
Interesting - I didn't realize that it was that important for computational physics. Very cool, I'll have to read up!
Re:PyTorch vs. TensorFlow in 2022 by 6gvONxR4sf7o on Tuesday December 14, 2021 @12:06PM (#29554095)
> Every day spent learning JAX is another day spent not reviewing literature, writing papers, or developing new models.

Every day spent learning JAX is also another day spent not trying to fit a round peg into a square hole of other libraries. I made the leap when I was doing things that were painful in pytorch. In terms of time, I think I came out ahead.

Not everything is a nail, and pytorch is better for some things, an jax is better for others. "Every day spent learning the screwdriver is a day spent not using your hammer."

Re:PyTorch vs. TensorFlow in 2022 by SleekEagle on Tuesday December 14, 2021 @12:41PM (#29554566)
Totally agree! Always a cost/benefit analysis to consider, so it's nice to hear that it was worth it for someone who made the jump.
Re:PyTorch vs. TensorFlow in 2022 by time_to_smile on Tuesday December 14, 2021 @02:08PM (#29555923)
> Every day spent learning JAX

To get started JAX is just knowing Python and adding `grad`, `jit` and `vmap` to the mix, it takes about 5 minutes to get going.

To me this is the real power of JAX, it can be viewed as a few functions that make it easy to take any python code you've written and work with derivatives using that. This gives it tremendous flexibility in helping you solve problems.

As an example, I mostly do statistical work with it, rather than NN focused work. It took probably a few minutes to implement a GLM with custom priors over all the parameters, and the use then Hessian for the Laplace approximation of parameter uncertainty. The proper way to solve this would have been using PyMC but this worked good enough for me, and building the model in scratch in JAX took less time than refreshing the PyMC api for me.