Python Frameworks

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. At Practicum AI, we generally find Keras/TensorFlow easier to learn, so that is what our courses will focus on. As Keras continues to develop support for TensorFlow, we feel this will continue to make it the easiest and best option for getting started.

PyTorch is generally easier to work with if you want complete control of how your model is implemented and trained. At the same time, TensorFlow is usually easier when using the most common methods and settings. With the more extended support of Keras, which makes deep learning even more accessible from the user perspective (though again, sacrificing some fine-grained control), TensorFlow has the reputation of being the more accessible framework with which to get started.

We hope that the new direction that Keras is moving will combine ease of use with flexibility and allow users to benefit from the specific strengths of different underlying frameworks.

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.


Return to the Module 1 page or Continue to Module 2.