简体   繁体   中英

Python - TensorFlow and Keras

I've been searching all about What is Tensorflow and Keras. They say that Tensorflow runs on top of Keras which means that Tensorflow is the "BACKEND" of KERAS. (Although you can use others like Theano and CNTK)

Does the "BACKEND" term here mean it does the whole mathematical process thing behind a deep learning model? What I mean is like Tensorflow is the one who does the complicated stuffs like processing the matrices (tensor), doing all the math stuff?

On the other hand KERAS is the guy that is needed ONLY for us to create a MODEL, right? and ONCE the model is created, its "BACKEND" is Tensorflow, right? cause for the MODEL TO WORK AS IT SHOULD BE (like process matrices and do all the math stuffs) it needs a "BACKEND" which is Tensorflow.

That is what I understand based on some open forums and the Keras documentation :

Keras is a model-level library, providing high-level building blocks for developing deep learning models. It does not handle itself low-level operations such as tensor products, convolutions and so on. Instead, it relies on a specialized, well-optimized tensor manipulation library to do so, serving as the “backend engine” of Keras.

Is my understanding correct? Please enlighten me if you have other answers.

When we say that Tensorflow is the backend of Keras, we mean that Keras do not do calculations by itself. Keras just provide easy to use functions that use more complex Tensorflow code. It is then a little less powerful but it is sufficient in most cases. And when it is not, you can add Tensorflow code in your Keras Code as they both use The same Tensorflow objects in background.

Keras is now the official Tensorflow High level API, it is then a part of Tensorflow.

As of a greater version of TensorFlow (1.8) and all the later + latest versions of TensorFlow, Keras is integrated inside TensorFlow.

The recommended way to use Keras is to use it inside TensorFlow, practically if you import a layer you should do like from tensorflow.keras import X, Y .

Keras indeed is a high-level API which supports multiple back-end frameworks, such as Theano(which is obsolete by the way) or MXNET etc.

Since Keras was easier to use and a lot of people opted for Keras in spite of TensorFlow, whose learning curve was very poor in comparison with Keras, TensorFlow decided to integrate Keras inside their framework.

Practically, in the meantime, the creator of Keras became part of the Google development team, hence the integration of Keras inside TensorFlow.

If you are just staring with deep learning, ensure that you are using Keras inside TensorFlow . It is more robust, less prone to errors. In addition to this, Keras will enter maintenance mode (as of 2.3.X) no major version will be released anymore, only maintenance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM