As we have seen, libraries like Pandas and NumPy make using Python for specific tasks more manageable. As AI applications were being developed, coders built frameworks (which can be considered extensive collections of libraries that enable complex tasks—like doing AI research) to facilitate their AI research. Competing teams of coders, mostly at large companies like Meta (Facebook) and Google, developed competing frameworks. While the primary goals and many underlying methods are similar, these frameworks have different ways of interacting with them and different strengths and weaknesses. The most common frameworks are PyTorch and TensorFlow. Keras started as an easy-to-use framework for interacting with other frameworks. At one time, it focused on TensorFlow, but as of version 3, released in Fall 2023, it now supports TensorFlow, PyTorch, and JAX.
Which framework to use?
This is a challenging question to answer, and the answer may change over time.
At Practicum AI, we started using TensorFlow/Keras as they abstract a lot of the code, making it easier to learn for simple use cases.
Way back in 2023 (😅), when this course was initially developed, TensorFlow made sense. However, in the past couple of years, PyTorch has really dominated the market. Additionally, the Keras changes noted above have not been smooth, and PyTorch support is limited; a lot of TensorFlow code broke, further pushing people to PyTorch.
For this course, which already had a TensorFlow version of the code, we will attempt to maintain that. But we have made a PyTorch version, and will most likely develop all future courses in PyTorch. That said, we are taking a slightly easier approach (we hope) and are using PyTorch Lightning, a module built on top of PyTorch that standardizes and simplifies some of the PyTorch code, while at the same time facilitating scaling training beyond a single GPU or even server.
Ultimately, it is worth looking at the papers published in your field of interest and seeing what the authors use. It may be easier to advance your field by sticking with the same framework others are using.
Lastly, these are all frameworks to implement aspects of AI model training. Once you understand what you are doing, it is not difficult to use the strengths of different frameworks to your advantage and mix and match methods.