Should I be using Keras vs. TensorFlow for my project? Is TensorFlow or Keras better? Should I invest my time studying TensorFlow? Or Keras?
I’ll continue to discuss the Keras vs. TensorFlow argument and how it’s the wrong question to be asking.
From there we’ll implement a Convolutional Neural Network (CNN) using both the standard keras module along with the tf.keras module baked right into TensorFlow.
We’ll train these CNNs on an example dataset and then examine the results — as you’ll find out, Keras and TensorFlow live together in harmony.
And perhaps most importantly, you’ll learn why the Keras vs. TensorFlow argument doesn’t make much sense anymore.
Asking whether you should be using Keras or TensorFlow is the wrong question — and in fact, the question doesn’t even make sense anymore. Even though it’s been over a year since TensorFlow announced that Keras will be integrated into official TensorFlow releases, I’m still surprised by the number of deep learning practitioners who are unaware that they can access Keras via the tf.keras sub-module.
And more to the point — that the Keras + TensorFlow integration is seamless, allowing you to drop raw TensorFlow code directly into your Keras model.
Using Keras inside of TensorFlow gives you the best of both worlds:
In prior years, deep learning researchers, practitioners, and engineers often had to choose:
Luckily, we don’t have to choose anymore.
Including Keras inside tf.keras allows you to to take the following simple feedforward neural network using the standard Keras package:
And then implement the same network using the tf.keras submodule which is part of TensorFlow:
Does this mean that you have to use tf.keras ? Is the standard Keras package now obsolete? No, of course not.
Keras as a library will still operate independently and separately from TensorFlow so there is a possibility that the two will diverge in the future; however, given that Google officially supports both Keras and TensorFlow, that divergence seems extremely unlikely.
The point is this:
If you’re comfortable writing code using pure Keras, go for it, and keep doing it.
You need to login in order to like this post: click here
YOU MIGHT ALSO LIKE