Deep Learning Practical Assignment #1:: Instructions
Deep Learning Practical Assignment #1:: Instructions
Instructions
Read all the instructions below carefully before you start working on the assignment.
• Please submit your notebook to your corresponding git branch in our git work-space.
• Code that does not work will be graded accordingly. Please focus on the algorithms
you are implementing.
1
1 Working with perceptron algorithm
We can implement the perceptron algorithm in different ways. One of these implementation
is the followings:
Question 1
In this section, we aim to understand the space complexity and time complexity of the simple
perceptron algorithm.
Question 1.a
What is the computational/time complexity of the basic perceptron algorithm.
Please define the complexity as function of the variables defined in the provided algorithm
Question 1.b
What is the space complexity of the basic perceptron algorithm.
Please define the complexity as function of the variables defined in the provided algorithm
Implement from scratch only the perceptron algorithm, for data splitting and suffling and
other operations, you can use 3rd party libraries
2
2.1 Toy data set
Consider a data set S = {(xi , yi )}250
i=1 consisting of 250 points xi = (x1 , x2 ) and their labels
yi .
• The first 125 xi have label yi = −1 and are generated according to a Gaussian distri-
bution xi ∼ N (µ1 , σ12 I) , where
−1
µ1 =
0
• The last 125 xi have label yi = 1 and are generated according to a Gaussian distribution
xi ∼ N (µ2 , σ22 I) , where
1
µ2 =
0
After shuffling the data-set, split it into train and test set, containing 80% and 20% of the
dataset.
2.2 Experiments
Implement the perceptron algorithm
Experiment 1
Generate one data set for σ12 = σ22 = 0.25.
• Question 2: Plot the decision boundary found by your algorithm. Is this decision
boundary unique? Does changing the initialisation changes the result of the algorithm?
• Question 3: Compute the accuracy of the classification on the test set. Plot the
decision boundary on the test set.
Experiment 2
Generate one data set for σ12 = σ22 = 0.75.
• Question 2: Plot the decision boundary found by your algorithm. Is this decision
boundary unique? Does changing the initialisation changes the result of the algorithm?
• Question 3: Compute the accuracy of the classification on the test set. Plot the
decision boundary on the test set.
3
Comment the results found in the previous two experiments.
The result should be similar to the figure below, varying the variance will impact the result
Experiment 3
We define one experiment as following
In order to study the impact of varying σ12 and σ22 on the performance of the system, we
store the error over multiple experiments (take nb experiment = 30). Then we compute the
mean and the variance of the stored errors.
for each σ12 and σ22 ∈ [0.01, 0.1, 0.5, 0.7] compute the mean and variance then plot the results
using matplotlib.pyplot.errorbar .
4
Comment the result.