0% found this document useful (0 votes)
7 views5 pages

Deep Learning Viva

The document provides an introduction to TensorFlow, covering its installation, basic operations, and key concepts like tensors and TensorFlow graphs. It explains deep neural networks, convolutional neural networks, and recurrent neural networks, detailing their structures, functions, and applications. Additionally, it discusses model evaluation techniques, regularization, and hyperparameter tuning to improve model performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views5 pages

Deep Learning Viva

The document provides an introduction to TensorFlow, covering its installation, basic operations, and key concepts like tensors and TensorFlow graphs. It explains deep neural networks, convolutional neural networks, and recurrent neural networks, detailing their structures, functions, and applications. Additionally, it discusses model evaluation techniques, regularization, and hyperparameter tuning to improve model performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Module 1: Introduction to TensorFlow

1. What is TensorFlow and why is it used in deep learning?


TensorFlow is an open-source framework developed by Google for numerical
computation and large-scale machine learning. It's widely used in deep learning
because it provides tools to easily build, train, and deploy neural networks using
tensors and computational graphs.

2. How do you install TensorFlow? Which versions are you using?


You can install it using pip:
pip install tensorflow
Latest version is typically TensorFlow 2.x (e.g., 2.14). Use tensorflow==2.x if a specific
version is needed.

3. What is the role of the TensorFlow graph?


A TensorFlow graph is a representation of computations as a series of connected
nodes. It defines the operations and how data flows between them.

4. What are Tensors in TensorFlow?


Tensors are multi-dimensional arrays (like NumPy arrays) that represent data.
Everything in TensorFlow is based on tensors.

5. Can you name some key libraries that should be installed along with TensorFlow?

o NumPy

o SciPy

o Matplotlib

o Pandas

o Statsmodels

o Scikit-learn

Module 2: Basic Operations in TensorFlow

6. How do you compute a simple function like 2 + 2 + 2 using TensorFlow?

import tensorflow as tf

a = tf.constant(2)

result = a + a + a

print(result)
7. How can you evaluate expressions in TensorFlow?
In TensorFlow 2.x, expressions are evaluated eagerly, so you can just print the tensor.
In TF 1.x, you needed to run a session to evaluate.

8. What is the purpose of a TensorFlow session (in v1) or tf.function (in v2)?
In TF 1.x, a session was required to execute the graph. In TF 2.x, tf.function is used to
convert Python functions into TensorFlow graphs for better performance.

Module 3: AND Gate Implementation

9. How can you implement a logic gate like AND using TensorFlow?
Using basic neural network with 2 inputs and 1 output. Inputs are (0,0), (0,1), (1,0),
(1,1) and target output is [0, 0, 0, 1]. Use sigmoid activation.

10. What activation function would you use in such a logic gate model?
Sigmoid, because it outputs values between 0 and 1 which are suitable for binary
classification.

Module 4–7: Deep Neural Networks

11. What is a Deep Neural Network (DNN)?


A DNN is a neural network with multiple hidden layers between input and output. It
can model complex relationships.

12. What is the difference between 2D and 3D datasets in the context of DNNs?

o 2D: Typically image datasets (height × width)

o 3D: Includes an additional channel (e.g., RGB channels in images: height ×


width × channels)

13. What is the purpose of regularization in neural networks?


To prevent overfitting by penalizing large weights. Common types are L1 and L2
regularization.

14. How does dropout help in preventing overfitting?


Dropout randomly turns off neurons during training, forcing the network to not rely
on any single node, improving generalization.

15. What is early stopping and how does it improve training?


Early stopping stops training when validation performance starts to degrade,
preventing overfitting.

Module 8: Convolutional Neural Networks (CNNs)


16. What is a CNN and how is it different from a DNN?
CNN is a type of neural network that uses convolutional layers to extract features
from spatial data (e.g., images). Unlike DNNs, CNNs preserve spatial structure.

17. Explain the purpose of convolution and pooling layers.

o Convolution: Extracts features using filters.

o Pooling: Reduces dimensionality and computation, and helps in generalizing


the model.

18. What are some common use cases of CNNs?

o Image classification

o Object detection

o Face recognition

o Medical imaging analysis

Module 9: Model Evaluation

19. What is cross-validation? Why do we use five-fold cross-validation?


Cross-validation splits the data into k folds (e.g., 5). The model trains on k-1 and tests
on the remaining. It ensures robustness and generalization.

20. How can you improve the performance of a model?

o Hyperparameter tuning

o Using dropout, batch normalization

o Increasing training data

o Transfer learning

o Regularization techniques

Module 10: Recurrent Neural Networks (RNNs)

21. What is an RNN and where is it used?


RNN is a type of neural network for sequential data. It maintains a memory of
previous inputs. Used in language modeling, time series prediction, etc.

22. How is an RNN different from a CNN or DNN?


RNN handles sequence/time-series data using feedback loops. CNNs are spatial, and
DNNs are feedforward.
23. Why are RNNs suitable for text classification?
Because they can capture the order and context of words in a sentence using
memory of previous inputs.

General & Conceptual

24. What is the difference between training and testing datasets?

o Training: Used to teach the model

o Testing: Used to evaluate its performance on unseen data

25. What is an epoch? What does batch size mean?

o Epoch: One full pass over the entire training dataset

o Batch size: Number of samples processed before the model updates weights

26. Explain overfitting and underfitting.

o Overfitting: Model learns too much from training data (poor generalization)

o Underfitting: Model is too simple to learn patterns from the data

27. What optimizers have you used in your models? (e.g., SGD, Adam)

o SGD (Stochastic Gradient Descent)

o Adam (Adaptive Moment Estimation) – faster and widely used

28. What is a loss function? Give examples.


Loss function measures how far predictions are from actual values.

o For classification: Categorical cross-entropy

o For regression: Mean Squared Error (MSE)

29. Can you explain what backpropagation is?


It's the process of updating weights by computing gradients of loss w.r.t each weight,
and moving in the opposite direction to minimize loss.

30. What are hyperparameters? How do you tune them?


Hyperparameters are set before training (e.g., learning rate, batch size).
Tuning is done using:

o Grid search

o Random search

o Bayesian optimization
31. Experiment 2: Compute the function (x, y) = x² +
y² + 2x + y
How do you implement mathematical functions using TensorFlow?

A: By defining tensors x and y using tf.constant() or tf.Variable() and


performing operations like addition or squaring using TensorFlow's built-in functions.

Q9: What is regularization? Why is it added to DNNs?

A: Regularization (like L2) penalizes large weights in the model to prevent overfitting and
improve generalization.

Q10: What’s the difference between L1 and L2 regularization?

A: L1 adds absolute weight values to loss (sparse models); L2 adds squared weights to loss
(smooth models).

Q15: What are the core components of a CNN model?

A: Convolution layers, pooling layers, flattening, and dense (fully connected) layers.

Q16: What is the purpose of pooling layers?

A: To reduce spatial dimensions, computation, and help in generalization by extracting


dominant features.

Q17: What is five-fold cross-validation?

A: The dataset is split into 5 parts; 4 are used for training and 1 for validation. This process
repeats 5 times for robustness.

Q18: Why is cross-validation important?

A: It helps in reducing bias and variance, ensuring the model performs well across unseen
data.

Experiment 10: Text Classification using RNN


Q19: Why are RNNs suitable for text classification?

A: RNNs maintain memory of previous words in a sequence, capturing the context necessary
for language understanding.

Q20: What are common challenges in training RNNs?

A: Vanishing gradient problem, long training times, and difficulty in capturing long-term
dependencies.

You might also like