- #1
fog37
- 1,568
- 108
- TL;DR Summary
- understand the difference and how to use Keras and TensorFlow
Hello,
Anyone using Keras and TensorFlow? I know there is TensorFlow 1 and TensorFlow 2. I am getting familiar with these two important deep learning libraries. So far, my understanding is the Keras library must be always imported along with the TensorFlow library but I have seen some code examples where only Keras is imported and the code works just fine...
If Keras is a high level API for TensorFlow, how can we use Keras alone without importing also Tensorflow? My understanding is that Keras is the front-end while TensorFlow is the back-end which means that Keras essentially allows us to use TensorFlow methods and functionalities without directly making calls to Tensorflow (which is running under the hood). Everything is done just through Keras...
The following code snippet has only Keras imported:
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizer import SGD
On the other hand, the code below shows both keras an tensorflow being imported in the dependencies:
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten, Activation, Dropout
Then I also saw the following code examples:
from tensorflow import keras as ksfrom tensorflow.keras import backend as K
Anyone using Keras and TensorFlow? I know there is TensorFlow 1 and TensorFlow 2. I am getting familiar with these two important deep learning libraries. So far, my understanding is the Keras library must be always imported along with the TensorFlow library but I have seen some code examples where only Keras is imported and the code works just fine...
If Keras is a high level API for TensorFlow, how can we use Keras alone without importing also Tensorflow? My understanding is that Keras is the front-end while TensorFlow is the back-end which means that Keras essentially allows us to use TensorFlow methods and functionalities without directly making calls to Tensorflow (which is running under the hood). Everything is done just through Keras...
The following code snippet has only Keras imported:
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizer import SGD
On the other hand, the code below shows both keras an tensorflow being imported in the dependencies:
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten, Activation, Dropout
Then I also saw the following code examples:
from tensorflow import keras as ksfrom tensorflow.keras import backend as K