Keras is a higher-level API used with TensorFlow as the backend. Adding layers to it is as easy as adding a single line of code. After the model architecture, using one line of code, you can compile and fit the model. Later, it can be used for prediction. Declaration of variables, placeholders, and even the session is managed by the API.
Higher-level APIs-Keras
How to do it...
We proceed with Keras as follows:
- As the first step, we define the type of our model. Keras offers two types of models: sequential and Model class API. Keras offers various types of neural network layers:
# Import the model and layers needed from keras.model import Sequential from keras.layers import Dense model = Sequential()
- Add the layers...