Introduction to Neural Networks

Similar documents
Introduction to Artificial Neural Networks

Artificial Neural Networks. Edward Gatt

Artificial Neural Networks Examination, June 2005

Artificial Neural Networks Examination, March 2004

Machine Learning. Neural Networks

Artificial Neural Networks Examination, June 2004

Plan. Perceptron Linear discriminant. Associative memories Hopfield networks Chaotic networks. Multilayer perceptron Backpropagation

Neural networks. Chapter 20. Chapter 20 1

Lecture 7 Artificial neural networks: Supervised learning

Neural networks. Chapter 19, Sections 1 5 1

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

Artificial Neural Networks The Introduction

Supervised (BPL) verses Hybrid (RBF) Learning. By: Shahed Shahir

ARTIFICIAL NEURAL NETWORK PART I HANIEH BORHANAZAD

Artificial Neural Networks. Q550: Models in Cognitive Science Lecture 5

Neural Networks and Fuzzy Logic Rajendra Dept.of CSE ASCET

Part 8: Neural Networks

Neural networks. Chapter 20, Section 5 1

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

Simple Neural Nets For Pattern Classification

Data Mining Part 5. Prediction

(Feed-Forward) Neural Networks Dr. Hajira Jabeen, Prof. Jens Lehmann

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

Artificial Neural Networks

Neural Networks. Mark van Rossum. January 15, School of Informatics, University of Edinburgh 1 / 28

Artificial Neural Network and Fuzzy Logic

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

Learning and Memory in Neural Networks

Feedforward Neural Nets and Backpropagation

Artificial Neural Network : Training

Artificial Neural Networks Examination, March 2002

Unit III. A Survey of Neural Network Model

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

Christian Mohr

CHALMERS, GÖTEBORGS UNIVERSITET. EXAM for ARTIFICIAL NEURAL NETWORKS. COURSE CODES: FFR 135, FIM 720 GU, PhD

ARTIFICIAL INTELLIGENCE. Artificial Neural Networks

Artificial Intelligence

Lecture 4: Feed Forward Neural Networks

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

EEE 241: Linear Systems

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

Neural Networks. Fundamentals Framework for distributed processing Network topologies Training of ANN s Notation Perceptron Back Propagation

Artifical Neural Networks

Artificial Neural Networks. MGS Lecture 2

4. Multilayer Perceptrons

ECE 471/571 - Lecture 17. Types of NN. History. Back Propagation. Recurrent (feedback during operation) Feedforward

Artificial Neural Networks. Historical description

ARTIFICIAL NEURAL NETWORKS گروه مطالعاتي 17 بهار 92

Introduction to Neural Networks

Artificial Neural Networks. Part 2

Course 395: Machine Learning - Lectures

Introduction Biologically Motivated Crude Model Backpropagation

Fundamentals of Neural Networks

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

Artificial Neural Network

In biological terms, memory refers to the ability of neural systems to store activity patterns and later recall them when required.

Last update: October 26, Neural networks. CMSC 421: Section Dana Nau

Artificial Neural Networks (ANN) Xiaogang Su, Ph.D. Department of Mathematical Science University of Texas at El Paso

18.6 Regression and Classification with Linear Models

Artificial Intelligence Hopfield Networks

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

Neural Networks biological neuron artificial neuron 1

Lecture 4: Perceptrons and Multilayer Perceptrons

Administration. Registration Hw3 is out. Lecture Captioning (Extra-Credit) Scribing lectures. Questions. Due on Thursday 10/6

Revision: Neural Network

Sections 18.6 and 18.7 Artificial Neural Networks

Neural Networks (Part 1) Goals for the lecture

Neural Networks and Deep Learning

Introduction To Artificial Neural Networks

COMP9444 Neural Networks and Deep Learning 11. Boltzmann Machines. COMP9444 c Alan Blair, 2017

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

Supervised Learning in Neural Networks

CS:4420 Artificial Intelligence

Ch.8 Neural Networks

Basic Principles of Unsupervised and Unsupervised

Neural Nets in PR. Pattern Recognition XII. Michal Haindl. Outline. Neural Nets in PR 2

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

Sections 18.6 and 18.7 Artificial Neural Networks

Chapter 2 Single Layer Feedforward Networks

INTRODUCTION TO ARTIFICIAL INTELLIGENCE

Pattern Classification

Last updated: Oct 22, 2012 LINEAR CLASSIFIERS. J. Elder CSE 4404/5327 Introduction to Machine Learning and Pattern Recognition

Chapter ML:VI. VI. Neural Networks. Perceptron Learning Gradient Descent Multilayer Perceptron Radial Basis Functions

Multilayer Perceptron

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

Master Recherche IAC TC2: Apprentissage Statistique & Optimisation

Multilayer Neural Networks

Hopfield Neural Network and Associative Memory. Typical Myelinated Vertebrate Motoneuron (Wikipedia) Topic 3 Polymers and Neurons Lecture 5

Artificial Neural Networks. Introduction to Computational Neuroscience Tambet Matiisen

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

Lecture 10. Neural networks and optimization. Machine Learning and Data Mining November Nando de Freitas UBC. Nonlinear Supervised Learning

DEEP LEARNING AND NEURAL NETWORKS: BACKGROUND AND HISTORY

Reading Group on Deep Learning Session 1

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

Neural Networks DWML, /25

Computational Neuroscience. Structure Dynamics Implementation Algorithm Computation - Function

Reification of Boolean Logic

Neural Networks Introduction

CSE 352 (AI) LECTURE NOTES Professor Anita Wasilewska. NEURAL NETWORKS Learning

Neural Networks Lecturer: J. Matas Authors: J. Matas, B. Flach, O. Drbohlav

Transcription:

Introduction to Neural Networks

What are (Artificial) Neural Networks? Models of the brain and nervous system Highly parallel Process information much more like the brain than a serial computer Learning Very simple principles Very complex behaviours Applications As powerful problem solvers As biological models

Basic Input-Output Transformation Input Spikes! Output Spike! (Excitatory Post-Synaptic Potential)! 3

McCulloch Pitts neuron (943) Attributes of neuron m binary inputs and binary output (simplified model) Synaptic weights w ij Threshold i 4

McCulloch Pitts Neural Networks Synchronous discrete time operation Time quantized in units of synaptic delay ( ) = Θ& w ij n j ( t) n i t + $ %& j ' i ) () ni output of unit i Θ step function w weight from unit ij to ji Output is if and only if weighted ij = sum of inputs is greater than threshold i = threshold Θ(x) = if x 0 and 0 if x < 0 (Θ, the output function, is called activation function) Remarks: Behavior of network can be simulated by a finite automaton (FA) Any FA can be simulated by a McCulloch-Pitts Network 5

Properties of Artificial Neural Networks High level abstraction of neural input-output transformation Inputs à weighted sum of inputs à nonlinear function à output Often used where data or functions are uncertain Goal is to learn from a set of training data And to generalize from learned instances to new unseen data Key attributes Parallel computation Distributed representation and storage of data Learning (networks adapt themselves to solve a problem) Fault tolerance (insensitive to component failures) 6

Topologies of Neural Networks completely connected feedforward (directed, a-cyclic) recurrent (feedback connections) 7

Networks Types Feedforward versus recurrent networks Feedforward: No loops, input à hidden layers à output Recurrent: Use feedback (positive or negative) Continuous versus spiking Continuous networks model mean spike rate (firing rate) Assume spikes are integrated over time Consistent with rate-code model of neural coding Supervised versus unsupervised learning Supervised networks use a teacher The desired output for each input is provided by user Unsupervised networks find hidden statistical patterns in input data Clustering, principal component analysis 8

History 943: McCulloch Pitts neuron Started the field 96: Rosenblatt s perceptron Learned its own weight values; convergence proof 969: Minsky & Papert book on perceptrons Proved limitations of single-layer perceptron networks 98: Hopfield and convergence in symmetric networks Introduced energy-function concept 986: Backpropagation of errors Method for training multilayer networks Present: Probabilistic interpretations, Bayesian and spiking networks 9

Perceptrons In machine learning, the perceptron is an algorithm for supervised learning of binary classifiers: functions that can decide whether an input (represented by a vector of numbers) belongs to one class or another. Attributes Layered feedforward networks Supervised learning Hebbian: Adjust weights to enforce correlations Parameters: weights w ij # Binary output = Θ(weighted sum of inputs) Output i = Θ% Take w o to be the threshold with fixed input. $ % j & w ij ξ j ( '( Single-layer Multilayer 0

Training Perceptrons to Compute a Function Given inputs ξ j to neuron i and desired output Y i, find its weight values by iterative improvement:. Feed an input pattern. Is the binary output correct? Yes: Go to the next pattern No: Modify the connection weights using error signal (Y i O i ) Increase weight if neuron didn t fire when it should have and vice versa η learning rate Learning rule is Hebbian (based on input/output correlation) This update rule is in fact the stochastic gradient descent update for linear regression, converging to least square error. converges in a finite number of steps if a solution exists Used in ADALINE (adaptive linear neuron) networks ξ j Y i i input desired output O actual output

Computational Power of Perceptrons Consider a single-layer perceptron Assume threshold units Assume binary inputs and outputs Weighted sum forms a linear hyperplane w ij ξ j = 0 j Consider a single output network with two inputs Only functions that are linearly separable can be computed Example: AND is linearly separable ξ o =

Linear inseparability Single-layer perceptron with threshold units fails if problem is not linearly separable Example: XOR Can use other tricks (e.g. complicated threshold functions) but complexity blows up Minsky and Papert s book showing these negative results was very influential 3

Solution in 980s: Multilayer perceptrons Removes many limitations of single-layer networks Can solve XOR Exercise: Draw a two-layer perceptron that computes the XOR function binary inputs ξ and ξ binary output One hidden layer Find the appropriate weights and threshold 4

Solution in 980s: Multilayer perceptrons Examples of two-layer perceptrons that compute XOR E.g. Right side network Output is if and only if x + y (x + y.5 > 0) 0.5 > 0 x y 5

Multilayer Perceptron Output neurons } One or more layers of hidden units (hidden layers) Input nodes The most common output function (Sigmoid): g( a) = + e g(a) Ψ(a) βa (non-linear squashing function) a 6

Example: Perceptrons as Constraint Satisfaction Networks out y? x y x 7

Example: Perceptrons as Constraint Satisfaction Networks out y + x y < 0 =0 = + x y > 0 x y x 8

Example: Perceptrons as Constraint Satisfaction Networks out y =0 = x y = =0 x y > 0 x y < 0 x 9

Example: Perceptrons as Constraint Satisfaction Networks out y =0 = - >0 = =0 x y x 0

Perceptrons as Constraint Satisfaction Networks out y + x y < 0 =0 = + x y > 0 = =0 x y > 0 x y < 0 x y x

Learning networks We want networks that configure themselves Learn from the input data or from training examples Generalize from learned data Can this network configure itself to solve a problem? How do we train it?

Gradient-descent learning Use a differentiable activation function Try a continuous function f ( ) instead of Θ( ) First guess: Use a linear unit (without activation function f ( ) ) Define an error function (cost function or energy function) E = i u # % Y u i $ % Then Δw ij = η E w ij = η j u & w ij ξ j ( '( % ' &' Y u i j The idea is to make the change of the weight proportional to the negative derivative of the error. ( w ij ξ j * ξ j, w ij =w ij +Δw ij )* Changes weights in the direction of smaller errors Minimizes the mean-squared error over input patterns Called Delta rule = adaline rule = Widrow-Hoff rule = LMS rule 3

Gradient-descent learning Then Δw ij = η E w ij = η About learning rate : u % ' &' Y u i ( w ij ξ j * )* In order for Gradient Descent to work we must set η to an appropriate value. This parameter determines how fast or slow we will move towards the optimal weights. If the η is very large we will skip the optimal solution. If it is too small we will need too many iterations to converge to the best values. So using a good η is crucial. j ξ j 4

Backpropagation of errors Use a nonlinear, differentiable activation function Such as a sigmoid f where h + exp( ρh) [ f = ρ f (-f) ] Use a multilayer feedforward network Outputs are differentiable functions of the inputs w ij ξ j Result: Can propagate credit/blame back to internal nodes Chain rule (calculus) gives Δw ij for internal hidden nodes Based on gradient-descent learning j 5

Backpropagation y i w ij h j v jk... x x x n 6

Backpropagation When a learning pattern is clamped, the activation values are propagated to the output units, and the actual network output is compared with the desired output values, we usually end up with an error in each of the output units. Let's call this error e o for a particular output unit o. We have to bring e o to zero. 7

Backpropagation Remark: Generally, there are two modes of learning/training to choose from: on-line and batch. In on-line training, each propagation is followed immediately by a weight update. In batch training, many propagations occur before updating the weights. 8

Backpropagation The simplest method to do this is the greedy method: we strive to change the connections in the neural network in such a way that, next time around, the error e o will be zero for this particular pattern. We know from the delta rule that, in order to reduce an error, we have to adapt its incoming weights according to the equation: Δw ij = -η Ε / w ij 9

Backpropagation In order to adapt the weights from input to hidden units, we again want to apply the delta rule. In this case, however, we do not have a value for the hidden units. 30

Backpropagation Calculate the activation of the hidden units h j n = f k = 0 v jk x k 3

Backpropagation And the activation of the output units y i = f j=0 w ij h j 3

33 Backpropagation If we have pattern to learn ( is from or more training patterns batch training), the error is ( ) 0 = = = = = i j n k jk ij i i j ij i i i i k j x v f w f t h w f t y t E (t i is target output for output unit i)

Backpropagation Δw ij = η E w ij = = η ( t i y ) i = η δ i h j. f ' ( A i )h j = where A i is the activation (weighted sum of inputs) of output unit i, and ( ) f '( A ) i δ i = t i y i. 34

Backpropagation Δv jk = η E v jk = η E h j h j = v jk.. ( ) f ' = η t i y ( i A i )w ij f ' A j i = η δ i w ij f '( A ) j x k i ( ) x k = where A j is the activation (weighted sum of inputs) of hidden unit j. 35

Backpropagation The weight correction is given by : Δw mn = η δ m x n where δ m = ( t m y ) m f '( A ) m if m is the output layer or δ m = f '( A ) m w sm δ s s if m is a hidden layer (where s runs through all output units) 36

Backpropagation For f (x) = + exp ρx ( ), we have f (x) = ρ f(x) (-f(x)) Therefore, if m is the output layer δ m = ( t m y ) m f '( A ) m = ( t m y m )ρy m ( y m ) and if m is a hidden layer δ m = f ' A m ( ) w sm δ s = ρh m ( h m ) w sm δ s s s (where s runs through all output units) 37

Backpropagation For example, if () f (x) = (that is, when ρ = ) + exp( x) and () is from a training batch containing only one training pattern (i.e. now like online training) Then, if m is the output layer ( ) y m ( y m ) δ m = t m y m and if m is an hidden layer So, δ m = h m ( h m ) s w sm δ s Δw mn = η δ m x n = ηδ m x n and the new weight w mn = w mn + Δw mn 38

Backpropagation Algorithm initialize network weights (often small random values) do for each batch of training patterns //on-line if only pattern/batch compute error E at the output units compute Δw ij for all weights from hidden layer to output layer // backward pass compute Δv jk for all weights from input layer to hidden layer // backward pass continued w ij = w ij + Δw ij and v jk = v jk + Δv jk //update network weights until E is less than the target error return the network 39

Backpropagation Can be extended to arbitrary number of layers but three is most commonly used Can approximate arbitrary functions: crucial issues are generalization to examples not in test data set number of hidden units number of samples speed of convergence to a stable set of weights (sometimes a momentum term α Δw pq is added to the learning rule to speed up learning) 4

Hopfield networks Act as autoassociative memories to store patterns McCulloch-Pitts neurons with outputs - or, and threshold Θ All neurons connected to each other Symmetric weights (w ij = w ji ) and w ii = 0 Asynchronous updating of outputs Let s i be the state of unit i At each time step, pick a random unit Set s i to if Σ j w ij s j Θ i ; otherwise, set s i to - completely connected 43

Hopfield networks Hopfield showed that asynchronous updating in symmetric networks minimizes an energy function and leads to a stable final state for a given initial state Define an energy function (analogous to the gradient descent error function) E = -/ Σ i,j w ij s i s j + Σ i s i Θ i Suppose a random unit i was updated: E always decreases! If s i is initially and Σ j w ij s j > Θ i, then s i becomes + Change in E = -/ Σ j (w ij s j + w ji s j ) + Θ i = - Σ j w ij s j + Θ i < 0!! If s i is initially + and Σ j w ij s j < Θ i, then s i becomes - Change in E = / Σ j (w ij s j + w ji s j ) - Θ i = Σ j w ij s j - Θ i < 0!! 44

Hopfield networks Note: Network converges to local minima which store different patterns. x 4 x Store p N-dimensional pattern vectors x,, x p using Hebbian learning rule: w ji = /N Σ m=,..,p x m,j x m,i for all j i; 0 for j = i W = /N Σ m=,..,p x m x m T (outer product of vectors; diagonal zero) T denotes vector transpose 45

Pattern Completion in a Hopfield Network à Local minimum ( attractor ) of energy function stores pattern 46

Radial Basis Function Networks output neurons one layer of hidden neurons input nodes 47

Radial Basis Function Networks output neurons propagation function: n a j = ( x i i, j ) i= input nodes 48

Radial Basis Function Networks output neurons output function: (Gauss bell-shaped function) h(a) Ψ(a) a h a σ ( a) = e input nodes 49

Radial Basis Function Networks output neurons output of network: out j = i w i, j h i input nodes 50

RBF networks Radial basis functions Hidden units store means and variances Hidden units compute a Gaussian function of inputs x, x n that constitute the input vector x Learn weights w i, means i, and variances σ i by minimizing squared error function (gradient descent learning) 5

RBF Networks and Multilayer Perceptrons output neurons RBF: MLP: input nodes 5

Recurrent networks Employ feedback (positive, negative, or both) Not necessarily stable Symmetric connections can ensure stability Why use recurrent networks? Can learn temporal patterns (time series or oscillations) Biologically realistic Majority of connections to neurons in cerebral cortex are feedback connections from local or distant neurons Examples Hopfield network Boltzmann machine (Hopfield-like net with input & output units) Recurrent backpropagation networks: for small sequences, unfold network in time dimension and use backpropagation learning 53

Recurrent networks (con t) Example Elman networks Partially recurrent Context units keep internal memory of part inputs Fixed context weights Backpropagation for learning E.g. Can disambiguate Aà Bà C and Cà Bà A Elman network 54

Unsupervised Networks No feedback to say how output differs from desired output (no error signal) or even whether output was right or wrong Network must discover patterns in the input data by itself Only works if there are redundancies in the input data Network self-organizes to find these redundancies Clustering: Decide which group an input belongs to Synaptic weights of one neuron represents one group Principal Component Analysis: Finds the principal eigenvector of data covariance matrix Hebb rule performs PCA! (Oja, 98) Δw i = η ξ i y Output y = Σ i w i ξ i 55

Self-Organizing Maps (Kohonen Maps) Feature maps Competitive networks Neurons have locations For each input, winner is the unit with largest output Weights of winner and nearby units modified to resemble input pattern Nearby inputs are thus mapped topographically Biological relevance Retinotopic map Somatosensory map Tonotopic map 56

Summary: Biology and Neural Networks So many similarities Information is contained in synaptic connections Network learns to perform specific functions Network generalizes to new inputs But NNs are woefully inadequate compared with biology Simplistic model of neuron and synapse, implausible learning rules Hard to train large networks Network construction (structure, learning rate etc.) is a heuristic art One obvious difference: Spike representation Recent models explore spikes and spike-timing dependent plasticity Other Recent Trends: Probabilistic approach NNs as Bayesian networks (allows principled derivation of dynamics, learning rules, and even structure of network) Not clear how neurons encode probabilities in spikes 63

References on ANN and Stock Prediction http://www.cs.berkeley.edu/~akar/iitk_website/ EE67/report_stock.pdf http://www.cs.ucsb.edu/~nanli/publications/ stock_pattern.pdf and the references in the papers above 64