# What more does TensorFlow offer to keras?

I'm aware that keras serves as a high-level interface to TensorFlow.

But it seems to me that keras can do many functionalities on its own (data input, model creation, training, evaluation).

Furthermore, some of TensorFlow's functionality can be ported directly to keras (e.g. it is possible to use a tf metric or loss function in keras).

My question is, what does TensorFlow offer that can't be reproduced in keras?

Deep Learning frameworks operate at 2 levels of abstraction:

• Lower Level: This is where frameworks like Tensorflow, MXNet, Theano, and PyTorch sit. This is the level where mathematical operations like Generalized Matrix-Matrix multiplication and Neural Network primitives like Convolutional operations are implemented.
• Higher Level: This is where frameworks like Keras sit. At this Level, the lower level primitives are used to implement Neural Network abstraction like Layers and models. Generally, at this level other helpful APIs like model saving and model training are also implemented.

You cannot compare Keras and TensorFlow because they sit on different levels of abstraction. I also want to take this opportunity to share my experience of using Keras:

• I do not agree that Keras is only useful for basic Deep Learning work. Keras is a beautifully written API. The functional nature of the API helps you completely and gets out of your way for more exotic applications. Keras does not block access to lower level frameworks.
• Keras results in much more readable and succinct code.
• Keras model Serialization/Deserialization APIs, callbacks, and data streaming using Python generators is very mature.
• Keras has been declared the official high level abstraction for TensorFlow.

If you use TensorFlow as your backend in keras, they more or less share a the same functionality. Through keras.backend you an access TensorFlow functions, while through tf.keras you have access to keras' the whole API through TensorFlow.

Since this is the case, I suggest you stick with keras and if you find something is missing (e.g. a metric or a loss function) you can import it through TensorFlow.

Keras as you say contains all the functionality but out of the box it only runs on CPU. By plugging in a backend such as TensorFlow or CNTK (which I personally prefer) you unlock the power of GPU which can vastly accelerate some ML workloads, particularly DL workloads. If you do not have a discrete GPU the benefits are minimal.

Most of the time in practice you can just set your backend and forget about it, and work entirely within Keras, even swap your backend for another and compare performance. So there is no need to learn the specifics of TF unless you want to code directly at a lower level.

Given that TensorFlow is a more low-level library than Keras in general you would see this offers extra flexibility and improved performance (albeit relatively minor, depends mostly on how you write your code). I would say, if you are in research or developing new types of neural networks, knowledge of TensorFlow would be very useful. Outside of that, you should be fine with Keras although understanding how TensorFlow works could still be helpful if you're using it as a backend.

However, a while ago I read that Keras and TensorFlow will become more integrated which would make life a lot easier for you.

Obviously this is only my personal view, therefore I'd like to point you to some extra articles so you can do some reading of your own. This discussion on Kaggle gives a great overview of arguments and when to use which. Medium post on this topic.

Every beginner has this query. It always seems that Keras solves the basic functionalities like data input, model creation, training, evaluation in fewer lines of code.

But then when you start developing a ML model from scratch , you realize that you can program a lot of math into the NN , and tensorflow library provides a lot of functionalities and control making those concepts practical. The mathematical aspects of Learning can be easily visualized and made using NN made using tf.