Comparing Tensorflow w/Keras
Tensroflow and Keras
While you can create networs with Tensorflow in this class we will use the framework that sits on top called Keras to create our networks and is official in Tensorflow and its use is encouraged.
with KERAS an example
Well, this is how you would do the following model (plain NN) using the sequential model paradigm in Keras:
from keras.models import Sequential |
- The first two lines of code import the Sequential model and the Dense and Activation layers, respectively. A Dense layer is a fully connected neural network, whereas an Activation layer is a very specific way of invoking a rich set of activation functions, such as ReLU and SoftMax, as in the previous example (these will be explained in detail later).
Alternative Keras
from keras.models import Sequential |
Now Using the Keras "Functional API" Alternative
from keras.layers import Input, Dense |