Lab 5: 16 th April Exercises on Neural Networks

Similar documents
Revision: Neural Network

Machine Learning

Lecture 4: Perceptrons and Multilayer Perceptrons

y(x n, w) t n 2. (1)

Training Multi-Layer Neural Networks. - the Back-Propagation Method. (c) Marcin Sydow

Artificial Neural Networks. Edward Gatt

COGS Q250 Fall Homework 7: Learning in Neural Networks Due: 9:00am, Friday 2nd November.

Multilayer Perceptrons and Backpropagation

Back-Propagation Algorithm. Perceptron Gradient Descent Multilayered neural network Back-Propagation More on Back-Propagation Examples

AN INTRODUCTION TO NEURAL NETWORKS. Scott Kuindersma November 12, 2009

Multilayer Neural Networks

Neural Networks. CSE 6363 Machine Learning Vassilis Athitsos Computer Science and Engineering Department University of Texas at Arlington

COMP 551 Applied Machine Learning Lecture 14: Neural Networks

2015 Todd Neller. A.I.M.A. text figures 1995 Prentice Hall. Used by permission. Neural Networks. Todd W. Neller

Neural Networks, Computation Graphs. CMSC 470 Marine Carpuat

Pattern Classification

Neural networks. Chapter 20. Chapter 20 1

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Artificial Neural Networks

SPSS, University of Texas at Arlington. Topics in Machine Learning-EE 5359 Neural Networks

Neural Networks (Part 1) Goals for the lecture

Answers Machine Learning Exercises 4

Introduction to Natural Computation. Lecture 9. Multilayer Perceptrons and Backpropagation. Peter Lewis

Course 395: Machine Learning - Lectures

Artificial Intelligence

Artificial Neural Networks" and Nonparametric Methods" CMPSCI 383 Nov 17, 2011!

Artificial Neural Networks

Neural networks III: The delta learning rule with semilinear activation function

Multilayer Neural Networks

Machine Learning

Neural networks. Chapter 19, Sections 1 5 1

Multilayer Perceptron = FeedForward Neural Network

Multilayer Perceptron

Introduction Neural Networks - Architecture Network Training Small Example - ZIP Codes Summary. Neural Networks - I. Henrik I Christensen

Intelligent Systems Discriminative Learning, Neural Networks

22c145-Fall 01: Neural Networks. Neural Networks. Readings: Chapter 19 of Russell & Norvig. Cesare Tinelli 1

Artificial Neuron (Perceptron)

Machine Learning. Neural Networks. Le Song. CSE6740/CS7641/ISYE6740, Fall Lecture 7, September 11, 2012 Based on slides from Eric Xing, CMU

Serious limitations of (single-layer) perceptrons: Cannot learn non-linearly separable tasks. Cannot approximate (learn) non-linear functions

100 inference steps doesn't seem like enough. Many neuron-like threshold switching units. Many weighted interconnections among units

Neural Networks and the Back-propagation Algorithm

ARTIFICIAL NEURAL NETWORK PART I HANIEH BORHANAZAD

Neural Networks. Chapter 18, Section 7. TB Artificial Intelligence. Slides from AIMA 1/ 21

CSE446: Neural Networks Spring Many slides are adapted from Carlos Guestrin and Luke Zettlemoyer

NN V: The generalized delta learning rule

Multilayer Neural Networks. (sometimes called Multilayer Perceptrons or MLPs)

Neural Networks. Xiaojin Zhu Computer Sciences Department University of Wisconsin, Madison. slide 1

Introduction to Machine Learning

Linear discriminant functions

Multilayer Neural Networks. (sometimes called Multilayer Perceptrons or MLPs)

Week 5: The Backpropagation Algorithm

Computational Intelligence Winter Term 2017/18

Machine Learning. Neural Networks. (slides from Domingos, Pardo, others)

Simple Neural Nets For Pattern Classification

Midterm: CS 6375 Spring 2015 Solutions

Neural Networks biological neuron artificial neuron 1

ARTIFICIAL INTELLIGENCE. Artificial Neural Networks

Artificial Neural Networks Examination, March 2004

Multilayer Perceptron

Computational Intelligence

Artificial Neural Networks

4. Multilayer Perceptrons

Neural networks. Chapter 20, Section 5 1

Need for Deep Networks Perceptron. Can only model linear functions. Kernel Machines. Non-linearity provided by kernels

Logistic Regression & Neural Networks

Artificial Neural Networks Examination, June 2005

Feedforward Neural Nets and Backpropagation

Part 8: Neural Networks

Statistical NLP for the Web

Data Mining Part 5. Prediction

In the Name of God. Lecture 11: Single Layer Perceptrons

AI Programming CS F-20 Neural Networks

Need for Deep Networks Perceptron. Can only model linear functions. Kernel Machines. Non-linearity provided by kernels

Neural Networks Learning the network: Backprop , Fall 2018 Lecture 4

Neural Networks Task Sheet 2. Due date: May

Machine Learning. Neural Networks

Classification goals: Make 1 guess about the label (Top-1 error) Make 5 guesses about the label (Top-5 error) No Bounding Box

Single Layer Perceptron Networks

Artificial Neural Networks Examination, June 2004

Midterm, Fall 2003

CSE 190 Fall 2015 Midterm DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO START!!!!

CS:4420 Artificial Intelligence

The perceptron learning algorithm is one of the first procedures proposed for learning in neural network models and is mostly credited to Rosenblatt.

Gradient Descent Training Rule: The Details

Multilayer Perceptrons (MLPs)

Introduction to Neural Networks

Supervised Learning in Neural Networks

Neural Networks. Nicholas Ruozzi University of Texas at Dallas

Input layer. Weight matrix [ ] Output layer

Artificial Neural Network

Networks of McCulloch-Pitts Neurons

Lecture 26: Backpropagation and its applications. Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay

Machine Learning for Large-Scale Data Analysis and Decision Making A. Neural Networks Week #6

) (d o f. For the previous layer in a neural network (just the rightmost layer if a single neuron), the required update equation is: 2.

Learning and Neural Networks

Learning Neural Networks

ECE521 Lectures 9 Fully Connected Neural Networks

Lecture 5: Logistic Regression. Neural Networks

Feed-forward Networks Network Training Error Backpropagation Applications. Neural Networks. Oliver Schulte - CMPT 726. Bishop PRML Ch.

Understanding How ConvNets See

Transcription:

Lab 5: 16 th April 01 Exercises on Neural Networks 1. What are the values of weights w 0, w 1, and w for the perceptron whose decision surface is illustrated in the figure? Assume the surface crosses the x 1 axis at -1 and the x axis at. The output of the perceptron is The equation of the decision surface (the line) is! =!"#(!! +!!!! +!!!! )!! +!!!! +!!!! = 0 We know the coordinates of points of this line: A=(-1,0) and B=(0,). Therefore, the equation of the line is!!!!!!!!!!!!! =!!!!!!!!!!!!!!!!(!!) =!!!!!!(!!)!!!!! + 1 =!!! +!!!! = 0 So,, -1 are possible values for the weights w 0, w 1, and w, respectively. To check if their signs are correct, consider a point on one side of the line, for instance the origin O=(0,0). The output of the perceptron for this point has to be negative, but the output of the perceptron using the candidate weights is positive. Therefore, we need to negate the previous values and conclude that!! =,!! =,!! = 1.

. (a) Design a two-input perceptron that implements the Boolean function A B. (b) Design the two-layer network of perceptrons that implements A XOR B. (a) The requested perceptron has 3 inputs: A, B, and the constant 1. The values of A and B are 1 (true) or -1 (false). The following table describes the output O of the perceptron: A B O = A B -1-1 -1-1 1-1 1-1 1 1 1-1 One of the correct decision surfaces (any line that separates the positive point from the negative points would be fine) is shown in the following picture. The line crosses the A axis at 1 and the B axis -1. The equation of the line is!!! =!!(!!)!!!!!(!!)! =! + 1 1! +! = 0 So 1, -1, 1 are possible values for the weights w 0, w 1, and w, respectively. Using this values the output of the perceptron for A=1, B=-1 is negative. Therefore, we need to negate the weights and therefore we can conclude that!! = 1,!! = 1,!! = 1. (b) A XOR B cannot be calculated by a single perceptron, so we need to build a two-layer network of perceptrons. The structure of the network can be derived by: Expressing A XOR B in terms of other logical connectives: A XOR B = (A B) ( A B) Defining the perceptrons P 1 and P for (A B) and ( A B) Composing the outputs of P 1 and P into a perceptron P 3 that implements o(p 1 ) o(p ) Perceptron P 1 has been defined above. P can be defined similarly. P 3 is defined in the course slides 1. In the end, the requested network is the following: NB. The number close to each unit is the weight w 0. 1 It is defined for 0/1 input values, but it can be easily modified for -1/+1 input values.

3. Consider two perceptrons A and B defined by the threshold expression w 0 x 1 +w x >0. Perceptron A has weight values w 0 =1, w 1 =, w =1 and perceptron B has weight values w 0 =0, w 1 =, w =1. Is perceptron A more_general_than perceptron B? A is more_general_than B if and only if instance <x 1,x >, B(<x 1,x >)=1 à A(<x 1,x >)=1. B(<x 1,x >) = 1 à x 1 +x > 0 à 1+x 1 +x > 0 à A(<x 1,x >) = 1

4. Derive a gradient descent training rule for a single unit with output o, where o=w 0 x 1 x 1 + +w n x n +w n x n The gradient descent training rule specifies how the weights are to be changed at each step of the learning procedure so that the prediction error of the unit decreases the most. The derivation of the rule for a linear unit is presented on pages 91-9 of the Mitchell, and on pages 4-6 of the course slides (ml_01_lecture_07). We can adapt that derivation and consider the output o.!e = $ out x = out x! out x " ( w 0 x 1x x 1x + +w n x nx +w n x nx ) Therefore, the gradient descent training rule is!e = $ out x! out x " ( w 0 x 1x x 1x + +w n x nx +w n x nx ) $ "x ix " x ix = out x $ "x ix " x ix

5. Consider a two-layer feed-forward neural network that has the topology shown in the figure. X 1 and X are the two inputs. Z 1 and Z are the two hidden neurons. Y is the (single) output neuron. w i, i=1..4, are the weights of the connections from the inputs to the hidden neurons. w j, j=5..6, are the weights of the connections from the hidden neurons to the output neuron. X 1 X w w 3 w 1 w 4 Z 1 Z w 5 w 6 Explain the three phases (i.e., input signal forward, error signal backward, and weight update) of the first training iteration of the Backpropagation algorithm for the current network, given the training example: (X 1 =x 1, X =x, Y=y). Please use the following notations for the explanation. Net 1, Net, and Net 3 are the net inputs to the Z 1, Z, and Y neurons, respectively. o 1, o, and o 3 are the output values for the Z 1, Z, and Y neurons, respectively. f is the activation function used for every neuron in the network, i.e., o k =f(net k ), k=1..3. E(w) = (y - o 3 ) / is the error function, where y is the desired network output. η is the learning rate δ 1, δ, and δ 3 are the error signals for the Z 1, Z, and Y neurons, respectively. Y Propagate the input forward through the network 1. Input the instance (x 1,x ) to the network and compute the network outputs o 3 Net 1 = w 1 x 1 + w x à o 1 =f(net 1 ) Net = w 3 x 1 + w 4 x à o =f(net ) Net 3 = w 5 f(net 1 )+w 6 f(net ) à o 3 =f(w 5 f(net 1 )+w 6 f(net )) Propagate the error backward through the network E(w) = (y - o 3 ) / = (y-f(w 5 f(net 1 )+w 6 f(net ))). Calculate the error term of out unit Y δ 3 =f (f(w 5 f(net 1 )+w 6 f(net )))*(y-f(w 5 f(net 1 )+w 6 f(net ))) 3. Calculate the error of the hidden units δ =f (f(net )δ 3 δ 1 =f (f(net 1 )δ 3 4. Update the network weights w 1 ß w 1 + ηδ 1 w 1 w ß w + ηδ w w 3 ß w 3 + ηδ 1 w 3 w 4 ß w 4 + ηδ w 4 w 5 ß w 5 + ηδ 3 w 5 w 6 ß w 6 + ηδ 3 w 6

6. In the Back-Propagation learning algorithm, what is the object of the learning? Does the Back- Propagation learning algorithm guarantee to find the global optimum solution? The object is to learn the weights of the interconnections between the inputs and the hidden units and between the hidden units and the output units. The algorithms attempts to minimize the squared error between the network output values and the target values of these outputs. The learning algorithm does not guarantee to find the global optimum solution. It guarantees to find at least a local minimum of the error function.