100% found this document useful (1 vote)
81 views3 pages

Exercise #1 7 - 4 - 2025

The document consists of a series of exercises focused on deep learning concepts, including multiple-choice questions, practical tasks involving TensorFlow and Python, and theoretical questions about model evaluation and architecture. It covers topics such as convolutional neural networks, data normalization, overfitting, and metrics for classification and regression models. Additionally, it includes tasks for implementing algorithms and analyzing performance metrics in deep learning models.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
81 views3 pages

Exercise #1 7 - 4 - 2025

The document consists of a series of exercises focused on deep learning concepts, including multiple-choice questions, practical tasks involving TensorFlow and Python, and theoretical questions about model evaluation and architecture. It covers topics such as convolutional neural networks, data normalization, overfitting, and metrics for classification and regression models. Additionally, it includes tasks for implementing algorithms and analyzing performance metrics in deep learning models.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exercise #1 7/4/2025

[1] MCQ
1- What major advantage does an MLP have over an SLP?
a) MLP can learn and model complex, non-linear relationships
b) MLP requires fewer computations
c) MLP does not need training data
d) MLP is always faster to train than SLP
2- What is the main advantage of using convolutional layers in CNNs compared to fully connected
layers?
a) They are faster but less accurate
b) They have fewer parameters and extract spatial features
c) They eliminate the need for activation functions
d) They replace the need for optimization algorithms
3- Deep learning (DL) is divided into three different evolutionary stages:
a) Supervised - Unsupervised – Semisupervised b) Representation– Evaluation– Optimization
c) Artificial narrow intelligence – Artificial general intelligence – Artificial superintelligence
d) Feature extraction – Dimensionality reduction – Complexity
4- The three most important components of every deep learning (DL) algorithm are:
a) Overfitting – understanding – computation speed b) Representation– Evaluation– Optimization
c) Feature extraction – Dimensionality reduction – Complexity d) All the previous
5- Factors to consider for improving DL models are:
a) the use of proper model architecture along with large enough data.
b) the quality, quantity, and relevance of the data you feed into it
c) training time, test time, accuracy, and size. d) a and b
6- Which of the following metrics are used to evaluate classification models?
a) Area under the ROC curve b) F1 score c) Confusion matrix d) All the before
7- Which of the following metrics are used to evaluate regression models?
a) Mean Squared Error (MSE) b) Accuracy c) Recall d) All the before
8- When deploying a deep learning model to edge devices with limited computational resources, what
is a common optimization technique?
a) Increasing the model's complexity
b) Using larger batch sizes during inference
c) Quantization and pruning of model parameters
d) Reducing the amount of data for inference
9- What role does data augmentation play in deep learning, particularly in computer vision tasks?
a) It decreases the model's complexity.
b) It reduces the size of the dataset.
c) It increases the amount of available training data.
d) It removes noise from the data.
10- What is the purpose of data normalization in deep learning?
a) To increase the noise in the data
b) To make the data more complex
c) To scale data to a specific range
d) To remove outliers from the data
11- Which of the following metrics are used to evaluate classification models?
a) Area under the ROC curve
b) F1 score
c) Confusion matrix
d) All the before

[2] Using the idea of a fully functioning feedforward network shows how to design a simple task: learning
the XOR function.
1- Draw the implementation network.
2- Write the TensorFlow (TF) code.

[3] Draw a diagram to show the stages of a deep learning workflow to solve real-world problems.

[4] Show a schematic presentation of the taxonomy of deep learning techniques into major applied categories.

[5] Convolution between a kernel k of odd size n and an image f is defined by the formula:
𝑛2 𝑛2

𝑔(𝑥. 𝑦) = ∑ ∑ 𝑘(𝑛2 + 𝑖, 𝑛2 + 𝑗)𝑓(𝑥 − 𝑖, 𝑦 − 𝑗)


𝑖=−𝑛2 𝑗=−𝑛2
𝑛
Where 𝑛2 = ⌊ ⌋, floor function.
2
1- Write the pseudocode for applying the convolution kernel to an image as stated above.
−3 3 3 2 1 4 −1
ii- Let 𝑘 = [ 3 −3 3 ] , 𝑓 = [0 3 1 1]
2 1 −1 2
3 3 −3
1 3 −4 2
Compute the convolution 𝐶 = 𝑘 ∗ 𝑓
ii) Consider the problem of parallelizing the application of a 3x3 convolution kernel for sharpening an image.
The kernel is a square matrix (3x3) with weights that are used in the calculation of the new pixel data. The
convolution between a kernel K of odd size n and an image f is defined by the formula:
𝑛2 𝑛2

𝑔(𝑥. 𝑦) = ∑ ∑ 𝑘(𝑛2 + 𝑖, 𝑛2 + 𝑗)𝑓(𝑥 − 𝑖, 𝑦 − 𝑗)


𝑖=−𝑛2 𝑗=−𝑛2
𝑛
Where 𝑛2 = ⌊ ⌋, floor function.
2
If, for example, a 3x3 kernel is used:
𝒌𝟎.𝟎 𝒌𝟎.𝟏 𝒌𝟎.𝟐
𝑲 = |𝒌𝟏.𝟎 𝒌𝟏.𝟏 𝒌𝟏.𝟐 |
𝒌𝟐.𝟎 𝒌𝟐.𝟏 𝒌𝟐.𝟐
then for each pixel at row i and column j, the new pixel value 𝑣 ′ 𝑖.𝑗 resulting from the convolution is determined
by the values of the pixel and its eight neighbors according to the formula:
𝒗′ 𝒊.𝒋 = 𝒗𝒊−𝟏.𝒋−𝟏 ∙ 𝒌𝟐.𝟐 + 𝒗𝒊−𝟏.𝒋 ∙ 𝒌𝟐.𝟏 + 𝒗𝒊−𝟏.𝒋+𝟏 ∙ 𝒌𝟐.𝟎
+𝒗𝒊.𝒋−𝟏 ∙ 𝒌𝟏.𝟐 + 𝒗𝒊.𝒋 ∙ 𝒌𝟏.𝟏 + 𝒗𝒊.𝒋+𝟏 ∙ 𝒌𝟏.𝟎
+𝒗𝒊+𝟏.𝒋−𝟏 ∙ 𝒌𝟎.𝟐 + 𝒗𝒊+𝟏.𝒋 ∙ 𝒌𝟎.𝟏 + 𝒗𝒊+𝟏.𝒋+𝟏 ∙ 𝒌𝟎.𝟎
Where v are original pixel values.
1- Show how to implement the application.
2- Write the Python code for applying the convolution kernel to an image as stated in (ii).

[6] Fill in the spaces with suitable numbers:


1- 3 5×5 convolutional kernels filter an input image 255x255 of a traffic sign at stride 2, which creates……
feature maps.
2- These feature maps are subsampled by max-pooling 3 (2x2), which gives …….. feature maps.
3- The next layer applies 10 (7×7) convolutional kernels at stride 3 to these subsampled images, which
give…… feature maps, and again we pool the feature maps by 10 (2x2) subsampling.
4- The next layer applies 6 (9×9) convolutional kernels at stride 4 to these subsampled images, which
give…… feature maps, and again we pool the feature maps by 6 (2x2) subsampling.
[7] What is the total number of parameters in the problem [6]?
[8] How do you verify that the model in problem [6] has no underfitting or overfitting?
[9] i) True/False
1- Regression analysis is a subcategory of supervised learning that aims to predict a categorical class label of
a new instance.
2- Classification is a method used to predict continuous target variables, which represent numerical values.
3- Data cleaning is the process of manipulating the data to make it usable for analysis, while data wrangling
is the process of making sure that the data is accurate and consistent.
4- Data scaling is the process of ensuring that all features contribute equally to the model and avoid the
domination of features with larger values.
5- Due to imbalanced data, most DL algorithms are unable to predict the minority class's data properly.
6- F1 score = 1⁄(1 + (𝐹𝑛 + 𝐹𝑝 )⁄2𝑇𝑝 ) ranges between 0 and 1.
ii) In the context of DL, choose from set B the definition that matches the expression in A.
A B
1- The philosophy of DL (DL) is a program generated by an algorithm without being
explicitly programmed by any human being.
2. A deep learning (DL) model is refers to a set of training examples where the labels are
already known.
3. Overfitting occurs associated tags or labels representing the outcome or
category of the data.
4. Deep Learning (DL) is built on the rules of inferences, heuristics, discovery,
reasoning, induction, and guesswork.
5. Supervised learning is represented as a vector 𝒙∈ ℝ𝒏 where each entry 𝒙𝒊 of the
vector is another feature.
6. Unsupervised learning rescaling features to the range of [0, 1]
7. Labeled data comes with is to reduce the effect of overfitting
8. A dataset example or sample when a model learns to perform well on the training data
but does not generalize well to unseen data.
9. Normalization refers to multi-neural network architecture statistical tool to explore
and analyze the data.
10. Advantage of using CNN over (MLP) is based on finding meaningful patterns and groups in the
unlabeled data based on features and purposes.

[10] i) What success and error rates are based on the


given confusion matrix in a multi-class prediction
problem? Does this give us a good metric?
ii) Compute the accuracy, precision, recall, and F1
score for each class.
iii) Draw a schematic diagram for a DL model to
find a compromise between its complexity and
prediction accuracy.

You might also like