Mar-03-2021, 07:13 PM
Hello,
I am new to deep learning but realize that Keras and TensorFlow are two very important DL libraries.
My understanding is that Keras is an API, a wrapper, and the front-end of TensorFlow. Do API and wrapper mean exactly the same thing?
Keras is a library containing functions that can be called to let us indirectly use the functionalities of TF more easily. Is that correct?
I believe TensorFlow can be used without using Keras but Keras must always be used with TensorFlow, correct? Both an API and a wrapper are an interface to something else...
I have seen Python script examples where only Keras was imported and TensorFlow wasn't. Is it because the newest version of TensorFlow (TensorFlow 2) is automatically imported when we import Keras alone?
Online, I noticed that different approaches. Some code imports tensorflow, some just keras. What is the correct syntax and way to use Keras and TF? Here the options I found:
1) Only tensorflow is imported:
import tensorflow as tfmodel = tf.keras.Sequential()
2) Here Keras is imported as an object inside tensorflow:
from tensorflow import keras
model = keras.Sequential()
3)Here there is no mention of TF and only Keras is imported:
import keras
from keras.models import Sequential
Which one is the correct approach?
Thank you!
bytecrunch
I am new to deep learning but realize that Keras and TensorFlow are two very important DL libraries.
My understanding is that Keras is an API, a wrapper, and the front-end of TensorFlow. Do API and wrapper mean exactly the same thing?
Keras is a library containing functions that can be called to let us indirectly use the functionalities of TF more easily. Is that correct?
I believe TensorFlow can be used without using Keras but Keras must always be used with TensorFlow, correct? Both an API and a wrapper are an interface to something else...
I have seen Python script examples where only Keras was imported and TensorFlow wasn't. Is it because the newest version of TensorFlow (TensorFlow 2) is automatically imported when we import Keras alone?
Online, I noticed that different approaches. Some code imports tensorflow, some just keras. What is the correct syntax and way to use Keras and TF? Here the options I found:
1) Only tensorflow is imported:
import tensorflow as tfmodel = tf.keras.Sequential()
2) Here Keras is imported as an object inside tensorflow:
from tensorflow import keras
model = keras.Sequential()
3)Here there is no mention of TF and only Keras is imported:
import keras
from keras.models import Sequential
Which one is the correct approach?
Thank you!
bytecrunch