Starting from:

$25

PR-Assignment 4 Solved

1.   Train a single perceptron and SVM to learn an AND gate with two inputs x1 and x2. Assume that all the weights of the perceptron are initialized as 0. Show the calulation for each step and also draw the decision boundary for each updation.

2.   Train a single perceptron and SVM to learn the two classes in the following table.

x1
x2
ω
2
2
1
-1
-3
0
-1
2
1
0
-1
0
1
3
1
-1
-2
0
1
-2
0
-1
-1
1
where x1 and x2 are the inputs and ω is the target class. Assume that all the weights of the perceptron are initialized as 0 with learning rate 0.01 and 0.5 separately. Also, tabulate the number of iterations required to converge the perception algorithm with these two learning rates.

3.   In the given I set of images from poly1.png to poly14.png, let poly1 to poly 7 belong to class 1 and poly 8 to poly 14 belong to class 2. Assume that all the weights of the perceptron are initialized as 0 with the learning rate of 0.01.

•    Identify two discriminant features x1 and x2 for the two target classes ω={ω1,ω2}. Here, ω1 - class 1 and ω2 - class 2.

•    Generate an input feature vector X for all the images mapping them to a corresponding taget classes ωi, where 

•    Train a single perceptron and SVM to learn the feature vector X mapping to ω.

•    Plot and draw the final decision boundary separating the three classes

From the iris dataset, choose the ’petal length’, ’sepal width’ for setosa, versicolor and virginica flowers. Learn a decision boundary for the two features using a single perceptron and SVM. Assume that all the weights of the perceptron are initialized as 0 with the learning rate of 0.01. Draw the decision boundary

More products