University of Sydney_COMP3308_Introduction to Artifical Intelligence_2014 Semester 1
COMP3308/3608 Artificial Intelligence
Week 7 Tutorial exercises Decision trees. Perceptrons.
Perceptron learning rule (Homework) Given is the following training set:
input output ex. 1: 1 0 0 1 ex. 2: 0 1 1 0 ex. 3: 1 1 0 1 ex. 4: 1 1 1 0 ex. 5: 0 0 1 0 ex. 6: 1 0 1 1
a) Train by hand a perceptron with a bias on this training set. Assume that all initial weights (including the bias of the neuron) are 0. Show the set of weights (including the bias) at the end of each iteration. Apply the examples in the given order.
Stopping criteria: all examples are correctly classified or a maximum number of 2 epochs is reached. Reminder: the stopping criteria are checked at the end of each epoch; to check the first part, apply each training example, check if it is correctly classified and stop if all examples are correctly classified. Note that when doing this, there is no weight change just calculating the actual output and comparing it with the target output.
Use the step function and note that step(0)=1. step(n) = 1, if n >= 0 = 0, otherwise.
b) Which stopping condition was satisfied? If it was the first one, how many epochs were needed?
Solution:
a) starting point: w=[0 0 0], b=0 iteration 1:
applying ex.1: p1= [1 0 0]T,t1=1 a=step([0 0 0][1 0 0]T+0)=step(0)=1 e=t1-a=1-1=0
wnew=[0 0 0]+0[1 0 0]T =[0 0 0] bnew= 0+0=0
i.e. no change in w and b as e=0 iteration 2:
applying ex.2: p2= [0 1 1]T,t2=0 a=step([0 0 0][0 1 1]T+0)=step(0)=1 e=t2-a=0-1=-1
wnew=[0 0 0]+(-1)[0 1 1]T =[0 -1 -1] bnew= 0+(-1)=-1
i.e. w an b have been updated Similarly:
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Tutorial_w4-solutions_英语学习_外语学习_教育专区。University of Sydney_COMP3308_Introduction ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Tutorial_w8-solutions_电脑基础知识_IT/计算机_专业资料。University of Sydney_COMP3308_...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Tutorial_w4_英语学习_外语学习_教育专区。University of Sydney_COMP3308_Introduction to ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Tutorial_w9_英语学习_外语学习_教育专区。University of Sydney_COMP3308_Introduction to ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Tutorial_w10_英语学习_外语学习_教育专区。University of Sydney_COMP3308_Introduction to ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_w12-solutions_电脑基础知识_IT/计算机_专业资料。University of Sydney_COMP3308_Introduction to ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Lecture_ai7b_英语学习_外语学习_教育专区。COMP3308/3608, Lecture 7b ARTIFICIAL INTELLIGENCE ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Lecture_ai9b_英语学习_外语学习_教育专区。COMP3308/3608, Lecture 9b ARTIFICIAL INTELLIGENCE ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_quiz-sample-...Sample questions The quiz questions are similar to the tutorial exercises. ...
COMP3308_Introduction to Artifical Intelligence_2014 Semester 1_Lecture_ai3b_英语学习_外语学习_教育专区。COMP3308/COMP3608, Lecture 3b ARTIFICIAL INTELLIGENCE...
热门文档