Learn how to decide which back-end tool to use with Keras.
- [Narrator] Keras is a high-level tool for coding and training neural networks. You can think of it as a set of building blocks that you can combine to create neural networks, but Keras is just the front-end layer. It doesn't do all the processing on its own. Instead, it utilizes a separate deep-learning library under the hood for the processing. But what makes Keras especially unique is that it isn't limited to using just one deep-learning library. Keras currently lets you choose between Google's TensorFlow or the University of Montreal's Theano as the library to power your neural networks.
Each has its own advantages and both are very capable and popular choices. Let's check out some of the similarities and differences between the two choices. Theano was originally created by the University of Montreal's MILA, or Montreal Institute for Learning Algorithms group and released as open source. Theano has been around for a decade, much longer than TensorFlow. Over that time, it has been the tool behind many breakthroughs in machine learning research. Theano is written in Python and works well in conjunction with popular Python libraries like NumPy.
Theano also fully supports using the GPU on the 3D video card to accelerate processing. TensorFlow is an open source library created by Google. It's a recent creation. It was first released to the public in late 2015, but the first stable version wasn't released until 2017. TensorFlow has been used to solve very large scale problems. Google uses TensorFlow internally to build many of their popular services, like Google Translate. In many ways, it's very similar to Theano and was intended as a direct substitute.
Some of the same people who helped build Theano in academia went on to contribute to TensorFlow at Google. TensorFlow also supports accelerating calculations with GPUs but it also has advanced support for distributed processing across multiple GPUs and multiple computers. So what should you use with Keras? For this course, we'll be using TensorFlow, but given the many similarities between Theano and Tensorflow, either would be a good choice. With Keras, you can even install both and switch between them just by changing a config file.
The choice matters more when you want to use other tools that depend on either TensorFlow or Theano. For example, Google's cloud ML platform lets you upload TensorFlow models and run them in the cloud, but it doesn't work with Theano models. One of the great advantages of using Keras is that you can try running the same model on both TensorFlow and Theano. You can see which is a better fit for your project. In many cases, your Keras code will run on either backend system with little or no change.
- What's Keras?
- Using Keras vs. TensorFlow
- Training a deep learning model
- Using a pre-trained deep learning model
- Monitoring a Keras model with TensorBoard
- Using a trained Keras model in Google Cloud