Get Mystery Box with random crypto!

PyTorch or TensorFlow? You talk to people online, and everyon | Artificial Intelligence

PyTorch or TensorFlow?

You talk to people online, and everyone is a die-hard PyTorch fan. You talk to people offline, and everyone is a die-hard TensorFlow fan.

Many people ask me the same question: which of these frameworks should you learn?

The research community rallied around PyTorch for a good reason: it's much easier to understand than TensorFlow. PyTorch code feels and looks like Python code. TensorFlow 2 is much better, but the first version left a bad aftertaste.

TensorFlow, however, built a more extensive ecosystem for productizing Machine Learning systems. What they lacked in clarity, they made up with tooling. They also added Keras, which improved the developer experience by 100x.

If you are starting today, which one should you learn?

I usually recommend that people pick the one everyone else around them uses. If you start working for a company that uses TensorFlow, learn TensorFlow. If you join a research lab that uses PyTorch, learn PyTorch.

You can also decide based on the material you are using. For example, these are my three favorite technical books (in no particular order):

1. Deep Learning with Python by François Chollet

2. Hands-on Machine Learning with Scikit-Learn, Keras, and Tensorflow by Aurélien Géron

3. Machine Learning with PyTorch and Scikit-Learn by Sebastian Raschka, PhD

The first two use TensorFlow and Keras. The last one uses PyTorch. If you have any of these books, learn the framework they use.

Ultimately, you may need both, and switching is easier than you think. The fundamental principles of building machine learning don't change. Everything else is a stylistic choice.

By the way, Keras 3.0 is coming out soon in the November, and it's a big deal. You can write your code in Keras and swap the backend to TensorFlow, PyTorch, or JAX without any changes. You can also combine different frameworks in the same codebase.

Keras 3.0 will be a standalone library, and you won't need TensorFlow anymore. I'm a huge fan, and I can't wait for everyone to try it.