Deep Learning Interview Questions and Answers
Deep Learning Interview Questions and Answers
Check out some of the frequently asked deep learning interview questions below:
If you are going for a deep learning interview, you definitely know what exactly deep
learning is. However, with this question the interviewee expects you to give an in-
detail answer, with an example. Deep Learning involves taking large volumes of
structured or unstructured data and using complex algorithms to train neural
networks. It performs complex operations to extract hidden patterns and features (for
instance, distinguishing the image of a cat from that of a dog).
Neural Networks replicate the way humans learn, inspired by how the neurons in our
brains fire, only much simpler.
The most common Neural Networks consist of three network layers:
1. An input layer
2. A hidden layer (this is the most important layer where feature extraction takes
place, and adjustments are made to train faster and function better)
3. An output layer
Each sheet contains neurons called “nodes,” performing various operations. Neural
Networks are used in deep learning algorithms like CNN, RNN, GAN, etc.
As in Neural Networks, MLPs have an input layer, a hidden layer, and an output
layer. It has the same structure as a single layer perceptron with one or more hidden
layers. A single layer perceptron can classify only linear separable classes with
binary output (0,1), but MLP can classify nonlinear classes.
Except for the input layer, each node in the other layers uses a nonlinear activation
function. This means the input layers, the data coming in, and the activation function
is based upon all nodes and weights being added together, producing the output.
MLP uses a supervised learning method called “backpropagation.” In
backpropagation, the neural network calculates the error with the help of cost
function. It propagates this error backward from where it came (adjusts the weights
to train the model more accurately).
The process of standardizing and reforming data is called “Data Normalization.” It’s a
pre-processing step to eliminate data redundancy. Often, data comes in, and you get
the same information in different formats. In these cases, you should rescale values
to fit into a particular range, achieving better convergence.
One of the most basic Deep Learning models is a Boltzmann Machine, resembling a
simplified version of the Multi-Layer Perceptron. This model features a visible input
layer and a hidden layer -- just a two-layer neural net that makes stochastic
decisions as to whether a neuron should be on or off. Nodes are connected across
layers, but no two nodes of the same layer are connected.
At the most basic level, an activation function decides whether a neuron should be
fired or not. It accepts the weighted sum of the inputs and bias as input to any
activation function. Step function, Sigmoid, ReLU, Tanh, and Softmax are examples
of activation functions.
7. What Is the Cost Function?
Also referred to as “loss” or “error,” cost function is a measure to evaluate how good
your model’s performance is. It’s used to compute the error of the output layer during
backpropagation. We push that error backward through the neural network and use
that during the different training functions.
This is one of the most frequently asked deep learning interview questions.
Backpropagation is a technique to improve the performance of the network. It
backpropagates the error and updates the weights to reduce the error.
10. What Is the Difference Between a Feedforward Neural Network and
Recurrent Neural Network?
In this deep learning interview question, the interviewee expects you to give a
detailed answer.
A Feedforward Neural Network signals travel in one direction from input to output.
There are no feedback loops; the network considers only the current input. It cannot
memorize previous inputs (e.g., CNN).
The RNN can be used for sentiment analysis, text mining, and image captioning.
Recurrent Neural Networks can also address time series problems such as
predicting the prices of stocks in a month or quarter.
Softmax is an activation function that generates the output between zero and one. It
divides each output, such that the total sum of the outputs is equal to one. Softmax is
often used for output layers.
ReLU (or Rectified Linear Unit) is the most widely used activation function. It gives
an output of X if X is positive and zeros otherwise. ReLU is often used for hidden
layers.
This is another frequently asked deep learning interview question. With neural
networks, you’re usually working with hyperparameters once the data is formatted
correctly. A hyperparameter is a parameter whose value is set before the learning
process begins. It determines how a network is trained and the structure of the
network (such as the number of hidden units, the learning rate, epochs, etc.).
14. What Will Happen If the Learning Rate Is Set Too Low or Too High?
When your learning rate is too low, training of the model will progress very slowly as
we are making minimal updates to the weights. It will take many updates before
reaching the minimum point.
If the learning rate is set too high, this causes undesirable divergent behavior to the
loss function due to drastic updates in weights. It may fail to converge (model can
give a good output) or even diverge (data is too chaotic for the network to train).
Underfitting alludes to a model that is neither well-trained on data nor can generalize
to new information. This usually happens when there is less and incorrect data to
train a model. Underfitting has both poor performance and accuracy.
To combat overfitting and underfitting, you can resample the data to estimate the
model accuracy (k-fold cross-validation) and by having a validation dataset to
evaluate the model.
There are two methods here: we can either initialize the weights to zero or assign
them randomly.
Initializing all weights to 0: This makes your model similar to a linear model. All the
neurons and every layer perform the same operation, giving the same output and
making the deep net useless.
Initializing all weights randomly: Here, the weights are assigned randomly by
initializing them very close to 0. It gives better accuracy to the model since every
neuron performs different computations. This is the most commonly used method.
2. ReLU Layer - it brings non-linearity to the network and converts all the
negative pixels to zero. The output is a rectified feature map.
Master the deep learning concepts and TensorFlow open-source framework with
the Deep Learning Course with TensorFlow Certification. Check out the course
preview today.
Step 3: The network decides what part of the current state makes it to the
output.
22. What Are Vanishing and Exploding Gradients?
While training an RNN, your slope can become either too small or too large; this
makes the training difficult. When the slope is too small, the problem is known as a
“Vanishing Gradient.” When the slope tends to grow exponentially instead of
decaying, it’s referred to as an “Exploding Gradient.” Gradient problems lead to long
training times, poor performance, and low accuracy.
23. What Is the Difference Between Epoch, Batch, and Iteration in Deep
Learning?
Epoch - Represents one iteration over the entire dataset (everything put into
the training model).
Batch - Refers to when we cannot pass the entire dataset into the neural
network at once, so we divide the dataset into several batches.
Iteration - if we have 10,000 images as data and a batch size of 200. then an
epoch should run 50 iterations (10,000 divided by 50).
Tensorflow provides both C++ and Python APIs, making it easier to work on and has
a faster compilation time compared to other Deep Learning libraries like Keras and
Torch. Tensorflow supports both CPU and GPU computing devices.
This is another most frequently asked deep learning interview question. A tensor is a
mathematical object represented as arrays of higher dimensions. These arrays of
data with different dimensions and ranks fed as input to the neural network are called
“Tensors.”
Constants - Constants are parameters whose value does not change. To define a
constant we use tf.constant() command. For example:
a = tf.constant(2.0,tf.float32)
b = tf.constant(3.0)
Print(a, b)
W = tf.Variable([.3].dtype=tf.float32)
b = tf.Variable([-.3].dtype=tf.float32)
a = tf.placeholder (tf.float32)
b = a*2
result = sess.run(b,feed_dict={a:3.0})
print result
Sessions - a session is run to evaluate the nodes. This is called the “Tensorflow
runtime.” For example:
a = tf.constant(2.0)
b = tf.constant(4.0)
c = a+b
# Launch Session
Sess = tf.Session()
print(sess.run(c))
Suppose there is a wine shop purchasing wine from dealers, which they resell later.
But some dealers sell fake wine. In this case, the shop owner should be able to
distinguish between fake and authentic wine.
The forger will try different techniques to sell fake wine and make sure specific
techniques go past the shop owner’s check. The shop owner would probably get
some feedback from wine experts that some of the wine is not original. The owner
would have to improve how he determines whether a wine is fake or authentic.
The forger’s goal is to create wines that are indistinguishable from the authentic ones
while the shop owner intends to tell if the wine is real or not accurately.
Let us understand this example with the help of an image shown above.
There is a noise vector coming into the forger who is generating fake wine.
The Discriminator gets two inputs; one is the fake wine, while the other is the real
authentic wine. The shop owner has to figure out whether it is real or fake.
So, there are two primary components of Generative Adversarial Network (GAN)
named:
1. Generator
2. Discriminator
The generator is a CNN that keeps keys producing images and is closer in
appearance to the real images while the discriminator tries to determine the
difference between real and fake images The ultimate aim is to make the
discriminator learn to identify real and fake images.
Bagging and Boosting are ensemble techniques to train multiple models using the
same learning algorithm and then taking a call.
With Bagging, we take a dataset and split it into training data and test data. Then we
randomly select data to place into the bags and train the model separately.
With Boosting, the emphasis is on selecting data points which give wrong output to
improve the accuracy.
Conclusion
With this we come to an end of the top 30 deep learning interview questions and
answers article, that will help you land the perfect job that you always desired. Do
you feel unprepared regarding the concepts covered in these deep learning interview
questions? Then Simplilearn is here to help you upskill yourself. We offer Deep
Learning with TensorFlow Certification courses that will assist you in gaining
expertise in all the concepts of Deep Learning, and also add a shining star to your
resume. Start learning now!
Deep Learning with Keras and 23 Oct -14 Nov 2021, Bangalor View
TensorFlow Weekend batch e Details
Deep Learning with Keras and 20 Nov -12 Dec 2021, View
Chennai
TensorFlow Weekend batch Details
Shivam Arora
Shivam Arora is a Senior Product Manager at Simplilearn. Passionate about driving
product growth, Shivam has managed key AI and IOT based products across
different business functi…
View More
Recommended Programs
Deep Learning with Keras and TensorFlow
11964 Learners
Recommended Resources
Video Tutorial
Ebook
Article
Video Tutorial
Ebook
prevNext