concept Keras in category Keras

appears as: Keras
Probabilistic Deep Learning: With Python, Keras and TensorFlow Probability

This is an excerpt from Manning's book Probabilistic Deep Learning: With Python, Keras and TensorFlow Probability.

DL has gained enormous popularity with the availability of software frameworks that are built to manipulate tensors. In this book, we mainly use Keras (https://keras.io/) and TensorFlow (https://www.tensorflow.org/). These are the two frameworks currently most often used by DL partitioners. TensorFlow is an open source framework developed by Google that comes with strong support for DL. Keras is a user friendly, high-level neural networks API, written in Python, and capable of running on top of TensorFlow, allowing for fast prototyping.

Listing 3.6 Construction of the computational graph in Keras
model = Sequential() #A model.add(Dense(1,input_dim=1, activation='linear')) #B  opt = optimizers.SGD(lr=0.0004) model.compile(loss='mean_squared_error',optimizer=opt)
# A Starts building the model
# B Adds a single dense layer with no activation function

Can we do something else to get a reasonable time as an approximation for the normalized posterior? There are two approaches: one is variational inference (VI) Bayes; the other is called Monte Carlo (MC) dropout. The variational Bayes approach is welded into TFP, providing Keras layers to do the VI. MC dropout is a simple approach that can be done in Keras as well.