0

I am currently working on estimating uncertainty in deep learning models. I came across this tutorial where a probablistic CNN is implemented for classification of MNIST dataset. However, the model is a custom deep model as show below

def get_probabilistic_model(input_shape, loss, optimizer, metrics):
"""
This function should return the probabilistic model according to the 
above specification.
The function takes input_shape, loss, optimizer and metrics as arguments, which should be
used to define and compile the model.
Your function should return the compiled model.
"""
model = Sequential([
    Conv2D(kernel_size=(5, 5), filters=8, activation='relu', padding='VALID', input_shape=input_shape),
    MaxPooling2D(pool_size=(6, 6)),
    Flatten(),
    Dense(tfpl.OneHotCategorical.params_size(10)),
    tfpl.OneHotCategorical(10, convert_to_tensor_fn=tfd.Distribution.mode)
])

model.compile(loss=loss, optimizer=optimizer, metrics=metrics)
return model

However, I want to use a pre-trained deep learning model like efficientnet or mobilenet above and get the estimate of uncertainty of predictions from those models for my problem. How do I go about doing that?

0 Answers0