Waqas Haider Khan Bangyal

Slides:



Advertisements
Similar presentations
Artificial Neural Networks
Advertisements

Perceptron Lecture 4.
Slides from: Doug Gray, David Poole
Introduction to Neural Networks Computing
Artificial Neural Networks (1)
Perceptron Learning Rule
Neural Network I Week 7 1. Team Homework Assignment #9 Read pp. 327 – 334 and the Week 7 slide. Design a neural network for XOR (Exclusive OR) Explore.
Machine Learning: Connectionist McCulloch-Pitts Neuron Perceptrons Multilayer Networks Support Vector Machines Feedback Networks Hopfield Networks.
Machine Learning Neural Networks
Simple Neural Nets For Pattern Classification
Prénom Nom Document Analysis: Artificial Neural Networks Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
PERCEPTRON. Chapter 3: The Basic Neuron  The structure of the brain can be viewed as a highly interconnected network of relatively simple processing.
1 Chapter 11 Neural Networks. 2 Chapter 11 Contents (1) l Biological Neurons l Artificial Neurons l Perceptrons l Multilayer Neural Networks l Backpropagation.
An Illustrative Example
Before we start ADALINE
Neural Networks. Background - Neural Networks can be : Biological - Biological models Artificial - Artificial models - Desire to produce artificial systems.
BEE4333 Intelligent Control
Dr. Hala Moushir Ebied Faculty of Computers & Information Sciences
Neurons, Neural Networks, and Learning 1. Human brain contains a massively interconnected net of (10 billion) neurons (cortical cells) Biological.
MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way
Presentation on Neural Networks.. Basics Of Neural Networks Neural networks refers to a connectionist model that simulates the biophysical information.
Artificial Neural Nets and AI Connectionism Sub symbolic reasoning.
Chapter 3 Neural Network Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University
Introduction to Artificial Neural Network Models Angshuman Saha Image Source: ww.physiol.ucl.ac.uk/fedwards/ ca1%20neuron.jpg.
1 Machine Learning The Perceptron. 2 Heuristic Search Knowledge Based Systems (KBS) Genetic Algorithms (GAs)
NEURAL NETWORKS FOR DATA MINING
LINEAR CLASSIFICATION. Biological inspirations  Some numbers…  The human brain contains about 10 billion nerve cells ( neurons )  Each neuron is connected.
Artificial Neural Networks. The Brain How do brains work? How do human brains differ from that of other animals? Can we base models of artificial intelligence.
1 Chapter 11 Neural Networks. 2 Chapter 11 Contents (1) l Biological Neurons l Artificial Neurons l Perceptrons l Multilayer Neural Networks l Backpropagation.
The Perceptron. Perceptron Pattern Classification One of the purposes that neural networks are used for is pattern classification. Once the neural network.
1 Lecture 6 Neural Network Training. 2 Neural Network Training Network training is basic to establishing the functional relationship between the inputs.
Neural Networks Presented by M. Abbasi Course lecturer: Dr.Tohidkhah.
Neural Networks Teacher: Elena Marchiori R4.47 Assistant: Kees Jong S2.22
Supervised learning network G.Anuradha. Learning objectives The basic networks in supervised learning Perceptron networks better than Hebb rule Single.
Image Source: ww.physiol.ucl.ac.uk/fedwards/ ca1%20neuron.jpg
EEE502 Pattern Recognition
Neural Networks 2nd Edition Simon Haykin
Perceptrons Michael J. Watts
Artificial Intelligence CIS 342 The College of Saint Rose David Goldschmidt, Ph.D.
Chapter 6 Neural Network.
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 2 ARTIFICIAL.
CS532 Neural Networks Dr. Anwar Majid Mirza Lecture No. 2 January 17 th, 2008 National University of Computer and Emerging Sciences.
Learning with Neural Networks Artificial Intelligence CMSC February 19, 2002.
Today’s Lecture Neural networks Training
Neural networks.
Big data classification using neural network
Artificial Neural Networks
Artificial Neural Networks I
Learning with Perceptrons and Neural Networks
Learning in Neural Networks
Chapter 2 Single Layer Feedforward Networks
Artificial Intelligence (CS 370D)
Artificial neural networks:
Real Neurons Cell structures Cell body Dendrites Axon
What is an ANN ? The inventor of the first neuro computer, Dr. Robert defines a neural network as,A human brain like system consisting of a large number.
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
FUNDAMENTAL CONCEPT OF ARTIFICIAL NETWORKS
CSSE463: Image Recognition Day 17
Hebb and Perceptron.
Data Mining with Neural Networks (HK: Chapter 7.5)
Chapter 3. Artificial Neural Networks - Introduction -
OVERVIEW OF BIOLOGICAL NEURONS
Neural Network - 2 Mayank Vatsa
Neural Networks.
Artificial Intelligence Lecture No. 28
CSSE463: Image Recognition Day 17
Neuro-Computing Lecture 2 Single-Layer Perceptrons
Artificial Neural Networks
David Kauchak CS158 – Spring 2019
Outline Announcement Neural networks Perceptrons - continued
Presentation transcript:

Waqas Haider Khan Bangyal Data Mining Waqas Haider Khan Bangyal

Artificial Neural Networks

In Today's Lecture ... Introduction What is a Neural Network? Mathematical Model of a Neuron Network Architectures Training Commonly Used Activation Functions Typical Problem Areas

Artificial Neural Networks Welcome to the World of Artificial Neural Networks Brain A marvelous piece of architecture and design. In association with a nervous system, it controls the life patterns, communications, interactions, growth and development of hundreds of million of life forms.

Some Statistics There are about 1010 to 1014 nerve cells (called neurons) in an adult human brain. Neurons are highly connected with each other. Each nerve cell is connected to hundreds of thousands of other nerve cells. Passage of information between neurons is slow (in comparison to transistors in an IC). It takes place in the form of electrochemical signals between two neurons in milliseconds. Energy consumption per neuron is low (approximately 10-6 Watts).

How do the actual neurons look like? Look more like some blobs of ink… aren’t they! Taking a more closer look reveals that there is a large collection of different molecules, working together coherently, in an organized manner. Put together, they form the best information processing system in the known universe.

Salient Features of a Neuron Nucleus Axon Synapse Axons from another neurons Cell Body Synapse Dendrites Mind you, a neuron is a three dimensional entity!

Information Processing in a Neural Network Flow of Information A few Neurons and their synaptic junctions

Mathematical Model of A Typical Neuron

Basics of an Artificial Neural Network An artificial neural network is an information processing system that has certain performance characteristics in common with biological neural networks. An ANN can be characterized by: Architecture: The pattern of connections between different neurons. Training or Learning Algorithms: The method of determining weights on the connections. Activation Function: The nature of function used by a neuron to become activated.

Architecture Single Layer Nets Multi-layer Nets There are two basic categories: Feed-forward Neural Networks These are the nets in which the signals flow from the input units to the output units, in a forward direction. They are further classified as: Single Layer Nets Multi-layer Nets Recurrent Neural Networks These are the nets in which the signals can flow in both directions from the input to the output or vice versa.

Model 1: A Single Layer Net w11 w21 w31 w12 w32 w13 w2m wnm w22 X1 X2 l Xn Input Units Y1 Y2 Ym l Output Units

Model 2: A Multi-Layer Net Biological Neurons In Action w11 wi1 wn1 w1j wij wnj w1p wip wnp v11 vj1 vp1 v1k vjk vpk v1m vjm vpm Input Units l Xi X1 Xn Output Units Y1 l Yk Ym l Hidden Units Z1 Zj Zp

Model 3: A Recurrent Net Y1 Ym X1 Xn w11 wnm 1 v1m v1n w1n w1m

Training Supervised Training Unsupervised Training Training is accomplished by presenting a sequence of training vectors or patterns, each with an associated target output vector. The weights are then adjusted according to a learning algorithm. During training, the network develops an associative memory. It can then recall a stored pattern when it is given an input vector that is sufficiently similar to a vector it has learned. Unsupervised Training A sequence of input vectors is provided, but no traget vectors are specified in this case. The net modifies its weights and biases, so that the most similar input vectors are assigned to the same output unit.

Common Activation Functions 1. Binary Step Function (a “threshold” or “Heaviside” function) 2. Bipolar Step Function 3. Binary Sigmoid Function (Logistic Sigmoid) 3. Bipolar Sigmoid 4. Hyperbolic - Tangent

Typical Problem Areas The number of application areas in which artificial neural networks are used is growing daily. Some of the representative problem areas, where neural networks have been used are: Pattern Completion: ANNs can be trained on a set of visual patterns represented by pixel values. If subsequently, a part of an individual pattern (or a noisy pattern) is presented to the network, we can allow the network’s activation to propagate through the net till it converges to the original (memorised) visual pattern. The network is acting like a “content- addressable” memory.

Typical Problem Areas Classification: An early example of this type of network was trained to differentiate between male and female faces. It is actually very difficult to create an algorithm to do so yet, an ANN has shown to have near-human capacity to do so. Optimization: It is notoriously difficult to find algorithms for solving optimization problems (e.g. TSP). There are several types of neural networks which have been shown to converge to ‘good-enough’ solutions i.e. solutions which may not be globally optimal but can be shown to be close to the global optimum for any given set of parameters.

Typical Problem Areas Feature Detection: An early example of this is the phoneme producing feature map of Kohonen: The network is provided with a set of inputs and must learn to pronounce the words; in doing so, it must identify a set of features which are important in phoneme production Data Compression: There are many ANNs which have been shown to be capable of representing input data in a compressed format loosing as little of the information as possible. Approximation: Given examples of an input to output mapping, a neural network can be trained to approximate the mapping so that a future input will give approximately the correct answer i.e. the answer which the mapping should give.

Typical Problem Areas Association: We may associate a particular input with a particular output so that given the same (or similar) input again, the net will give the same (or a similar) output again. Prediction: This task may be stated as: given a set of previous examples from a time series, such as a set of closing prices of Karachi Stock Exchange, to predict the next (future) sample. Control: For example to control the movement of a robot arm (or truck, or any non-linear process) to learn what inputs (actions) will have the correct outputs (results)

In Today's Lecture ... Perceptron Simple Perceptron for Pattern Classification Perceptron: Algorithm Perceptron: Example Perceptron: Matlab code the example Assignment 1

Perceptron Perceptrons had perhaps the most far-reaching impact of any of the early neural nets. A number of different types of Perceptrons have been used and described by various workers. The original perceptrons had three layers of neurons – sensory units, associator units and a response unit – forming an approximate model of a retina. Under suitable assumptions, its iterative learning procedure can be proved to converge to the correct weights i.e., the weights that allow the net to produce the correct output value for each of the training input patterns.

Simple Perceptron for Pattern Classification The architecture of a simple perceptron for performing single classification is shown in the figure. The goal of the net is to classify each input pattern as belonging, or not belonging, to a particular class. Belonging is signified by the output unit giving a response of +1; not belonging is indicated by a response of -1. A zero output means that it is not decisive. 1 X1 b w1 X2 Y2 w2 l wn Xn

Perceptron: Algorithm Initialize weights, bias and the threshold q. Also set the learning rate a such that ( 0 < a <=1). While stopping condition is false, do the following steps. For each training pair s:t, do steps 4 to 7. Set the activations of input units. xi = si Compute the response of the output unit. Update weights and bias if an error occurred for this pattern. If y is not equal to t (under some limit) then wi(new) = wi(old) + a xi t for i = 1 to n b(new) = b(old) + a t end if Test stopping condition: If no weight changed in step 3, stop, else continue.

Perceptron: Example Lets consider the following training data: Inputs Target x1 x2 t 1 1 1 1 0 -1 0 1 -1 0 0 -1 We initialize the weights to be w1 = 0, w2 = 0 and b = 0. Also we set a = 1, and q = 0.2. The following table shows the sequence in which the net is provided with the input one by one and checked for the required target.

Perceptron: Example 1 2 Input Bias x1 x2 yin y t w1 w2 b 1 1 1 1 1 1 1 Net Input Output Target Weights x1 x2 yin y t w1 w2 b 1 1 1 1 1 1 1 1 1 2 1 -1 1 1 1 1 1 -1 -1 1 -1 -1 -1 -1 2 1 1 1 -1 -1 1 1 1 1 1 1 1 -1 1 -1 1 1 -1 -2 1 -2 -1 -1 -2

Perceptron: Example 10 1 2 3 -4 Input Bias yin y t x1 x2 w1 w2 b -2 -1 -2 -1 Net Output Target Weights Thus the positive response is given by all the points such that And the negative response is given by all the points such that

Decision Boundaries We note that the output of the Perceptron is 1(positive), if the net input ‘yin’ is greater than q. Also that the output is -1(negative), if the net input ‘yin’ is less than –q. We also know that yin = b + x1*w1 + x2*w2 in this case Thus we have 2*x1 + 3*x2 – 4 > 0.2 (+ve output) 2*x1 + 3*x2 – 4 < -0.2 (-ve output) Removing the inequalities and simplifying them gives us the following two equations: 2*x1 + 3*x2 = 4.2 2*x1 + 3*x2 = 3.8

Decision Boundaries These two equations are equations of straight lines in x1,x2-plane. These lines geometrically separate out the input training data into two classes. Hence they serve as acting like decision boundaries. The two lines have the same slope, but their y-intercepts are different. So essentially, we have two parallel straight lines acting line decision boundaries for out input data. The parameter q, determines the separation between two lines (and hence the width of the indecisive region).

Perceptron: Example Graphically x1 x2 (1, 1) (0, 1) (0, 0) (1, 0) Undecided Region

Perceptron: Matlab Code and Assignment 1 The following slides contain the Matlab source code for the Simple Perceptron Studied in the class. Also find the first assignment in these slides

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Purpose: % This Matlab code is based on Perceptron learning rule % Part 1: Training data and various control parameters are defined % Part 2: Perceptron learning rule is used for training of the net % Part 3: The resulting network is tested for the input data % Part 4: Some exercises %%%%%%%%%%%%%%%%%%%%%%%%% Part 1 %%%%%%%%%%%%%%%%%% clear all % Initialize various parameters w(1) = 0 % Initialize weights, w(1) is bias weight. w(2) = 0; w(3) = 0 alpha = 1 % Learning Rate theta = 0.2 % Length of non-decisive region stopFlag = -1; % Stoping flag, -1 = do not stop and +1 = stop wtChange = 1; % Weight change Flag, -1 = no change, +1 = change epsilon = 0.001; % Termination Criteria epoch = 0; % Epoch counter % define training patterns noOfTrainingPatterns = 4; s(1,:) = [1 1 1]; t(1,1) = 1; s(2,:) = [1 1 0]; t(2,1) = -1; s(3,:) = [1 0 1]; t(3,1) = -1; s(4,:) = [1 0 0]; t(4,1) = -1;

%%%%%%%%%%%%%%%%%% Part 2 %%%%%%%%%%%%%%%%%% % Step 1: While stopping condition is false, do steps 1 to 6 while stopFlag < 0 % Step 2: For each training pair s:t, do steps 3 to 5 wtChange = -1; for i=1:noOfTrainingPatterns %Step 3: Set activations of each input unit x = s(i,:); outDesired = t(i,:); % Step 4: Compute activation of the output unit % Calculate the net input yin = x*w'; if yin > theta y = 1.; elseif yin < -theta y = -1.; else y = 0.; end

% Step 5: Update biases and weights if abs(outDesired-y) > epsilon w = w + (alpha*outDesired).*x; wtChange = 1.; end epoch, x, yin, y, outDesired, w if wtChange < 0 stopFlag = 1.; epoch = epoch + 1; end % of while loop

%%%%%%%%%% Part 3 %%%%%%%%%%%% % Lets pick one pattern at random from the training data. p=fix(1+rand*(noOfTrainingPatterns-1)) x=s(p,:) outDesired=t(p,:) % For testing, we simply give this as input to the trained net % and find out the output. yin = x*w'; if yin > theta y = 1.; elseif yin < -theta y = -1.; else y = 0.; end % print y and the desired output y, outDesired

That's it for today!