Disclaimer: the layer module has been completely removed in TensorFlow 2.0, and the layer definition using tf.keras.layers is the new standard; however, an overview of tf.layers is still worth reading because it shows how reasoning layer by layer to define deep models is the natural way to proceed and it also gives us an idea of the reasons behind the migration from tf.layers to tf.keras.layers.
Model definition and training
Defining models with tf.layers
As shown in the previous section, TensorFlow provides all the primitive features to define a neural network layer: the user should take care when defining the variables, the operation nodes, the activation functions, and the logging, and define a proper interface to handle...