50+ keras interview questions and answers

Spread the love

In this article,  I am covering keras interview questions and answers only. I am not covering like regular questions about NN and deep learning topics here, If you are interested know  basics you can refer, datascience interview questionsdeep learning interview questions.

What is Keras ?

Who is the Creator of Keras ?

François Chollet, He is currently working as an AI Researcher at Google

What is advantages of Keras ?

What is difference between keras and tensorflow ?

What is difference between keras and pytorch?

How to setup keras with tensorflow backend ?  

Types are layers in keras ?

  • Core Layers
  • Convolutional Layers
  • Pooling Layers
  • Locally-connected Layers
  • Recurrent Layers
  • Embedding Layers
  • Merge Layers
  • Advanced Activations Layers
  • Normalization Layers
  • Noise layers

What is input Layer ? When we will use this layer ?

What is Dense Layer ?  When we will use this layer ?

What is Convolutional Layer  ? When we will use this layer ?

What is Pooling Layer ? When we will use this layer ?

What is Locally Connected layers ? When we use this layers ?

What is Noise Layer ? When we will use this layer ?

What is Recurrent Layer ? When we will use this layer ?

What is Embedding Layer ? When we will use this layer ?

What is Merge Layer ? When we will use this layer ?

What is Normalization Layer ? When we will use this layer ?

What is Sequence Preprocessing in keras ?

What is Text Preprocessing in keras ?

What is Image Preprocessing in keras ?

What is activation function ?

Different Types of activation function in keras ?

Available activations

softmax

keras.activations.softmax(x, axis=-1)

elu

keras.activations.elu(x, alpha=1.0)

selu

keras.activations.selu(x)

softplus

keras.activations.softplus(x)

Softplus activation function.

softsign

keras.activations.softsign(x)

relu

keras.activations.relu(x, alpha=0.0, max_value=None, threshold=0.0)

tanh

keras.activations.tanh(x)

sigmoid

keras.activations.sigmoid(x)

hard_sigmoid

keras.activations.hard_sigmoid(x)

exponential

keras.activations.exponential(x)

linear

keras.activations.linear(x)

What are advanced activation functions in keras ?

LeakyReLU, PReLU

What are regularizers in keras ?

  • keras.regularizers.l1(0.)
  • keras.regularizers.l2(0.)
  • keras.regularizers.l1_l2(l1=0.01, l2=0.01)

What is initializers in keras ?

What are Different Types of initializers in keras ?

Initializer

keras.initializers.Initializer()

Zeros

keras.initializers.Zeros()

Ones

keras.initializers.Ones()

Constant

keras.initializers.Constant(value=0)

RandomNormal

keras.initializers.RandomNormal(mean=0.0, stddev=0.05, seed=None)

RandomUniform

keras.initializers.RandomUniform(minval=-0.05, maxval=0.05, seed=None)

TruncatedNormal

keras.initializers.TruncatedNormal(mean=0.0, stddev=0.05, seed=None)

VarianceScaling

keras.initializers.VarianceScaling(scale=1.0, mode=’fan_in’, distribution=’normal’, seed=None)

Orthogonal

keras.initializers.Orthogonal(gain=1.0, seed=None)

Identity

keras.initializers.Identity(gain=1.0)

glorot_normal

keras.initializers.glorot_normal(seed=None)

glorot_uniform

keras.initializers.glorot_uniform(seed=None)

he_normal

keras.initializers.he_normal(seed=None)

lecun_normal

keras.initializers.lecun_normal(seed=None)

he_uniform

keras.initializers.he_uniform(seed=None)

How can you create custom initializer in keras ?

What is Callback in Keras ?

What are different types of callbacks in keras ?

  • BaseLogger
  • TerminateOnNaN
  • ProgbarLogger
  • History
  • ModelCheckpoint
  • EarlyStopping
  • Arguments
  • RemoteMonitor
  • LearningRateScheduler
  • TensorBoard
  • ReduceLROnPlateau
  • CSVLogger
  • LambdaCallback

What are constraints in keras ?

What are available constraints in keras ?

  • MaxNorm
  • NonNeg
  • UnitNorm
  • MinMaxNorm

Different Types of metrics in keras ?

  • binary_accuracy
  • categorical_accuracy
  • sparse_categorical_accuracy
  • top_k_categorical_accuracy
  • sparse_top_k_categorical_accuracy

Different types of loss functions in keras ?

  • Mean_squared_error
  • Mean_absolute_error
  • Mean_absolute_percentage_error
  • Mean_squared_logarithmic_error
  • Squared_hinge
  • Hinge
  • Categorical_hinge
  • Logcosh

What are predefined models in Keras for images Classification  ?

Models for image classification with weights trained on ImageNet:

  • Xception
  • VGG16
  • VGG19
  • ResNet50
  • InceptionV3
  • InceptionResNetV2
  • MobileNet
  • DenseNet
  • NASNet
  • MobileNetV2

How can you plot a graph in keras ?

What is functional API in Keras ?

What is model functions in Keras ?

Compile, fit, evaluate, Predict, fit_generator, evaluate_generator,

How can you specify batch in keras ?

How can you run a model in keras ?

What is difference between fit and fit_generator ?

How can you do normalization in keras ?

How can you save a model in keras ?

What are Model Optimization  ?

What are different types optimizers in keras ?

SGD – Stochastic gradient descent optimizer.
keras.optimizers.SGD(lr=0.01, momentum=0.0, decay=0.0, nesterov=False)
RMSprop – RMSProp optimizer.
keras.optimizers.RMSprop(lr=0.001, rho=0.9, epsilon=None, decay=0.0)
Adagrad – Adagrad optimizer
keras.optimizers.Adagrad(lr=0.01, epsilon=None, decay=0.0)
Adadelta – Adadelta optimizer.
keras.optimizers.Adadelta(lr=1.0, rho=0.95, epsilon=None, decay=0.0)
Adam – A Method for Stochastic Optimization
keras.optimizers.Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
Adamax
keras.optimizers.Adamax(lr=0.002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0)
Nadam – Nesterov Adam optimizer.
keras.optimizers.Nadam(lr=0.002, beta_1=0.9, beta_2=0.999, epsilon=None, schedule_decay=0.004)

What learning rate ? How can you specify in keras ?

What is Error rate ? How can you decrease it ?

What is vanishing and exploding gradient problems?

How can you solve in gradient problems keras ?

How can you improve model accuracy in keras ?

Author: admin

Leave a Reply

Your email address will not be published. Required fields are marked *