Section - C: Unit 1
Section - C: Unit 1
UNIT 1
1. Give the comparison between Deep Learning and Machine Learning? Give any two
applications of Deep Learning?
3. Draw a simple neural network which consist of an input layer(4 nodes) ,two hidden
layer(3 nodes) and one output layer(2 node). Calculate total number of trainable
parameter (weight and bias) in that neural network.
Simple Neural Network and Trainable Parameters:
Structure: 4 input nodes, 2 hidden layers (3 nodes each), 2 output nodes.
Weights:
Input to hidden1: 4×3=12
Hidden1 to hidden2: 3×3=9
Hidden2 to output: 3×2=6
Total weights: 12+9+6=27
Biases: One bias per node except input: 3+3+2=8
Total Parameters: 27+8=35.
6. What is Backward Propagation? How do you update the value of Weights and bias In
neural network?
Backward Propagation and Updating Weights/Bias:
Concept: Backpropagation computes the gradient of the loss function with respect
to each parameter.
Steps:
o Compute forward pass.
o Calculate the error at output.
o Backpropagate the error through layers using chain rule.
7. Explain the concept of tensors in Machine learning and deep learning along with the
code.
8. How do you build Neural network using Keras? Explain it with an example along with
necessary code
Steps:
Define the model (Sequential or Functional).
Add layers (e.g., Dense for fully connected layers).
Compile the model (specify optimizer, loss, and metrics).
Train the model using fit.
model = Sequential([
Dense(32, activation='relu', input_shape=(10,)),
Dense(16, activation='relu'),
Dense(1, activation='sigmoid')
])
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
model.fit(x_train, y_train, epochs=10)
10. What is Activation Function? Explain the types of activation functions used in the
Neural network?
UNIT 2
3. What is Activation Function? Explain the types of activation functions used in the
Neural network.
5. What is Shallow feed forward network and deep feed forward neural network.
6. Explain gradient descent. How to train a neural network using forward propagation
and backward propagation?
Training Neural Network:
Forward Propagation: Compute predictions.
Backward Propagation: Update weights.
7. Write down the code to create a sequential model using Keras. What is epochs in
Neural network training.
Epochs:
o Number of passes over the entire dataset during training.
o Example: Training with 50 epochs means the model iterates through the
dataset 50 times.
10. What are constants, Variable and placeholder in Tensorflow version1.0 ? Explain in
detail with example?
UNIT 3
1. What is Backward Propagation? Write down all the steps involved in updating the
value of Weights and bias using Gradient Descent along with the equations in
Backward propagation
Backward Propagation
Backward propagation (backprop) adjusts the weights and biases of a neural
network to minimize the loss function.
Steps Involved:
1. Forward Pass: Compute the predicted output.
2. Compute Loss: Measure the difference between the predicted and actual
values using a loss function.
3. Backward Pass: Calculate gradients of the loss with respect to weights and
biases using the chain rule.
4. Update Parameters: Update weights and biases using
3. How to declare a variable and placeholder in tensorflow version1.0? Write down the
necessary code.
Saddle Point
A saddle point occurs when the gradient is zero, but the point is neither a local
minimum nor a maximum. For example, in a 3D surface, a saddle point looks like a
mountain ridge.
Challenges: The network can get stuck at saddle points, especially in high-
dimensional spaces.
Solutions:
o Use adaptive optimization algorithms (e.g., Adam or RMSProp).
o Add momentum to help escape flat regions.
5. Explain the concept of feature engineering. Why do we use drop out layers in neural
network?
6. Explain gradient descent. How to train a neural network using forward propagation
and backward propagation?
Loss functions in deep learning are mathematical functions used to measure the
difference between the predicted output of the model and the actual target value.
The goal is to minimize the loss function during training so that the model's
predictions become more accurate over time.
Common Types of Loss Functions:
1. Mean Squared Error (MSE):
2. Cross-Entropy Loss (Log Loss):
3. Hinge Loss:
4. Huber Loss:
5. Kullback-Leibler Divergence (KL Divergence):
9. Explain in detail about the Gradient Descent. How the batch Gradient descent is
different form the Stochastic and mini batch Gradient descent?
UNIT 4
1. What is Momentum Gradient descent? What are some algorithms have been
developed using the idea of using different learning rates for different weights
6. What is Momentum Gradient descent? What are some key differences between the
Adadelta, Adagrad and Adam optimizer?
Momentum Gradient Descent and Key Differences Between Optimizers
Momentum Gradient Descent: Improves the standard gradient descent by adding a
momentum term, helping the optimizer move faster in the right direction and
avoiding oscillations.
Key Differences Between Adadelta, Adagrad, and Adam:
1. Adagrad: Adapts the learning rate for each parameter based on the sum of
past squared gradients. It can lead to rapid decay of learning rates.
2. Adadelta: Improves upon Adagrad by considering a moving average of
squared gradients instead of the sum, preventing learning rates from
shrinking too quickly.
3. Adam: Combines the benefits of both momentum and adaptive learning
rates, using both first and second moments of the gradient. It is widely used
for a variety of tasks due to its efficiency and fast convergence.