PyTorch has already stood the test of time and proven that its development is led by a competent team.
PyTorch has already stood the test of time and proven that its development is led by a competent team.
Having barriers of entry is not always a bad thing - it forces people to learn and understand concepts instead of blindly following and copying and pasting code from a Medium article and praying that it works.
But I agree with you that there are many different use cases. Those people who want to do high-level work (I have some images, just give me a classifier) shouldn't need to deal with that complexity. IMO the big mistake was trying to merge all these different use cases into one framework. Let's hope JAX doesn't go down the same route.
Not quite sure why you picked those particular examples... JAX also requires usage of lax.cond, lax.while_loop, and ops.segment_sum. Only gather has been improved with slice notation support. IMO, TF has landed on a pretty nice solution to cond/while_loop via AutoGraph.
I'm ill-informed - but isn't that exactly what lax is?
In [1]: from jax import grad
In [2]: def f(x):
...: if x > 0:
...: return 3. * x ** 2
...: else:
...: return 5. * x ** 3
...:
In [3]: grad(f)(1.)
Out[3]: DeviceArray(6., dtype=float32)
In [4]: grad(f)(-1.)
Out[4]: DeviceArray(15., dtype=float32)
In the above example, the control flow happens in Python, just as it would in PyTorch. (That's not surprising, since JAX grew out of the original Autograd [1]!)Structured control flow functions like lax.cond, lax.scan, etc exist so that you can, for example, stage control flow out of Python and into an end-to-end compiled XLA computation with jax.jit. In other words, some JAX transformations place more constraints on your Python code than others, but you can just opt into the ones you want. (More generally, the lax module lets you program XLA HLO pretty directly [2].)
Disclaimer: I work on JAX!
[1] https://github.com/hips/autograd [2] https://www.tensorflow.org/xla/operation_semantics
JAX is indeed a different situation as it has a more original design (although TF1 came with a huge improvement in compilation speed, so maybe there were innovations under the hood). But I don't know if I like it. The framework itself is quite neat, but last time I checked, the accompanying NN libraries had horrifying designs.
And now there are already multiple NN libraries for JAX from Google...
You can do much of the jax stuff in pytorch, you can't do the high level nn.LSTM stuff in jax, you have to use like flax or objax or something.