Neural Networks References: “Artificial Intelligence for Games” "Artificial Intelligence: A new Synthesis"

Slides:



Advertisements
Similar presentations
Multi-Layer Perceptron (MLP)
Advertisements

1 Machine Learning: Lecture 4 Artificial Neural Networks (Based on Chapter 4 of Mitchell T.., Machine Learning, 1997)
Introduction to Neural Networks Computing
Artificial Neural Networks (1)
Ch. Eick: More on Machine Learning & Neural Networks Different Forms of Learning: –Learning agent receives feedback with respect to its actions (e.g. using.
1 Neural networks. Neural networks are made up of many artificial neurons. Each input into the neuron has its own weight associated with it illustrated.
Kostas Kontogiannis E&CE
Artificial Neural Networks
Machine Learning: Connectionist McCulloch-Pitts Neuron Perceptrons Multilayer Networks Support Vector Machines Feedback Networks Hopfield Networks.
Overview over different methods – Supervised Learning
Simple Neural Nets For Pattern Classification
Pattern Classification All materials in these slides were taken from Pattern Classification (2nd ed) by R. O. Duda, P. E. Hart and D. G. Stork, John Wiley.
1 Chapter 11 Neural Networks. 2 Chapter 11 Contents (1) l Biological Neurons l Artificial Neurons l Perceptrons l Multilayer Neural Networks l Backpropagation.
Artificial Neural Networks Artificial Neural Networks are (among other things) another technique for supervised learning k-Nearest Neighbor Decision Tree.
An Illustrative Example
Artificial Neural Networks
Before we start ADALINE
Data Mining with Neural Networks (HK: Chapter 7.5)
MLP Exercise (2006) Become familiar with the Neural Network Toolbox in Matlab Construct a single hidden layer, feed forward network with sigmoidal units.
CS 4700: Foundations of Artificial Intelligence
September 28, 2010Neural Networks Lecture 7: Perceptron Modifications 1 Adaline Schematic Adjust weights i1i1i1i1 i2i2i2i2 inininin …  w 0 + w 1 i 1 +
Image Compression Using Neural Networks Vishal Agrawal (Y6541) Nandan Dubey (Y6279)
Neural Networks. Background - Neural Networks can be : Biological - Biological models Artificial - Artificial models - Desire to produce artificial systems.
Radial-Basis Function Networks
Dr. Hala Moushir Ebied Faculty of Computers & Information Sciences
MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way
Artificial Neural Networks
Artificial Neural Nets and AI Connectionism Sub symbolic reasoning.
DIGITAL IMAGE PROCESSING Dr J. Shanbehzadeh M. Hosseinajad ( J.Shanbehzadeh M. Hosseinajad)
Explorations in Neural Networks Tianhui Cai Period 3.
Neural Networks AI – Week 23 Sub-symbolic AI Multi-Layer Neural Networks Lee McCluskey, room 3/10
ANNs (Artificial Neural Networks). THE PERCEPTRON.
 Diagram of a Neuron  The Simple Perceptron  Multilayer Neural Network  What is Hidden Layer?  Why do we Need a Hidden Layer?  How do Multilayer.
LINEAR CLASSIFICATION. Biological inspirations  Some numbers…  The human brain contains about 10 billion nerve cells ( neurons )  Each neuron is connected.
Artificial Intelligence Lecture No. 29 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
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.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 31: Feedforward N/W; sigmoid.
Multi-Layer Perceptron
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Image Recognition COMP # 18.
Non-Bayes classifiers. Linear discriminants, neural networks.
CS621 : Artificial Intelligence
Chapter 2 Single Layer Feedforward Networks
Introduction to Neural Networks Introduction to Neural Networks Applied to OCR and Speech Recognition An actual neuron A crude model of a neuron Computational.
EEE502 Pattern Recognition
CS 188: Artificial Intelligence Learning II: Linear Classification and Neural Networks Instructors: Stuart Russell and Pat Virtue University of California,
Perceptrons Michael J. Watts
Chapter 6 Neural Network.
Learning with Neural Networks Artificial Intelligence CMSC February 19, 2002.
CSE343/543 Machine Learning Mayank Vatsa Lecture slides are prepared using several teaching resources and no authorship is claimed for any slides.
Neural networks.
Learning with Perceptrons and Neural Networks
Real Neurons Cell structures Cell body Dendrites Axon
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
FUNDAMENTAL CONCEPT OF ARTIFICIAL NETWORKS
CSSE463: Image Recognition Day 17
CSE P573 Applications of Artificial Intelligence Neural Networks
Chapter 3. Artificial Neural Networks - Introduction -
XOR problem Input 2 Input 1
CSE 573 Introduction to Artificial Intelligence Neural Networks
network of simple neuron-like computing elements
Neural Networks Chapter 5
Neural Network - 2 Mayank Vatsa
CSSE463: Image Recognition Day 17
Lecture Notes for Chapter 4 Artificial Neural Networks
CSSE463: Image Recognition Day 17
Artificial Neural Networks
CSSE463: Image Recognition Day 17
Presentation transcript:

Neural Networks References: “Artificial Intelligence for Games” "Artificial Intelligence: A new Synthesis"

History In the 70’s it was *THE* approach to AI – Since then, not so much. Although it has crept back into some apps. – It still has it’s uses. Many different types of Neural Nets – (Multi-layer) Feed-forward (perceptron) – Hebbian – Recurrent

Overview Givens: – A set of n training cases (each represented by a m-bit “binary string”) – The “correct” p-bit answer for each training case. Supervised vs. Unsupervised Process: – Train a neural network to “learn” the training cases. Using the Neural Network. – When exposed to new (grey) inputs, it should pick the closest match. Better than decision trees in this respect. Basically: a classifier.

Example Application #1 Modeling a enemy AI. The AI can do one of these 4 actions: – Go for cover – Shoot nearest enemy – Run away – Idle Training cases: – 50 sample play-throughs, 40 samples (2000 cases) with: position of player (16 bits) health of player (6 bits) ammo-state of player (8 bits) – One of the following: Supervised training: The action the AI *should* have taken. Unsupervised training: A way to measure success (based on player/AI state)

Example Application #2 Training Cases: – 8 8x8 pixel images (black/white) (64 bits each) – For each a classification number (3 bits each) This is supervised learning. Use: – After training, feed it some images similar to one of the training cases (but not the same) – It *should* return the best classification number.

Perceptrons Modeled after a single neuron. Components: – Dendrites (Input) – Axon (Output) – Soma (Activation Function)

Part I: Perceptrons

Perceptron Activation functions

Perceptron Activation functions, cont. To convert the output of the sigmoid to a "crisp" value (when this is an output from the nnet), you count a value >= 0.5 as 1.

Perceptron Activation functions, cont.

Examples 1.0 I0I0 I1I1 Perceptron O0O0 w0w0 w1w1 w 2 =- δ

Why not XOR? The first two examples are linearly separable W2=δW2=δ In higher dimensions, the “dividing line” is a hyper-plane, not a plane. OUTPUT=0 OUTPUT=1

AND and OR δ=0.75 δ=0.4 AND OR

XOR You can’t draw a line to separate the “True”’s from the “False”’s

Multi-layer perceptron networks We can’t solve XOR with one perceptron, but we can solve it with 3. – The 0 th one in the first layer looks for [0, 1] – The 1 st one in the first layer looks for [1, 0] – The only one in the second layer OR’s the output of the first layer’s perceptrons

XOR NNet 1.0 I0I0 I1I1 Perceptron 00 O0O0 Perceptron 01 Perceptron Notation: W ij h = Weight to layer h, from input#j to perceptron#i W 00 0 W 10 0 W 01 0 W 11 0 W 02 0 W 12 0 W 00 1 W 01 1 W 02 1 hIjW ji h

Weight matrices + Feed-Forward

Feed Forward Example

Feed Forward Example, cont.

Part II: Training

Training intro

Training intro, cont. Observations: – If d == o, no change in W – d – o could be -1 or means the output was too high. Decreases weight +1 means the output was too low. Increase weight. – The f’ term indicates how “changeable” the value is f’ of 0 (when f is nearly 1 or nearly 0) means it’s “locked-in” f’ of 0.25 (when f is near 0.5) means it’s very changeable.

Training example Single perceptron. 2 inputs, one output. – Weights initially [0.3, 0.7, 0.0] Scenario#1 In=[0, 1,1]. DesiredOutput=0 Feed forward. f(0.7)= f’(0.7)= Err= W += 0.1 * (0 – 0.668) * * [0, 1,1] W is now [0.3, 0.685,-0.015] Feed forward. f(0.685)= f'(0.685)= Err= If we repeat this 299 more times: Err= Scenario#2 In=[0,1,1]. DesiredOutput=1 Feed forward. f(0.7)= f'(0.7)= Err=0.332 W += 0.1 * (1 – 0.668) * * [0,1,1] W is now [0.3, 0.707, 0.007] Feed forward. f(0.715)= f'(0.715)=0.22. Err=0.329 If we repeat this 299 more times: Err=0.055

Training example, cont. Basically, we're… – Adjusting weights: We subtract from the weight if the error is negative and we have a 1 for input – Negative Error == output is too high. We add to the weight if the error is positive and we have a 1 for input. – Positive Error == output is too low. If the input is 0, leave weight unchanged. – The threshold ( δ ) is a weight too, where the input is always 1. So even if the inputs are all 0, we could still change the threshold.

Training intro, cont. You repeatedly show examples, I – Perhaps in a random order Weight values will stabilize at “correct” values. – *IF* the answers are linearly separable (like AND; unlike XOR) – If they aren’t it, will at least minimize the error.

Training Hidden Layers A bit more complex… The last weight matrix ("below" the output) is trained just as with a single perceptron – Treat the rows as the weight vectors. – The error is the difference between the desired output and actual output (not "crispified") – Row i in the weight matrix is considered the weight vector For other matrices – The error is the error from the layer above weighted proportional to the (current) weight values feeding into that layer. Assigning blame

Training Hidden Layers Updating W i : If i is the last (top) matrix: Else: W Updating weights feeding into a hidden perceptron: – Divide up the error of perceptrons this one feeds into (assigning blame) – w k is the weight from the node we're feeding into to the kth node in the next layer up. – err k is the error of the kth node in the next layer up.

P 0,0 P 0,1 P 0,2 P 0,3 P 1,0 P 1,1 P 1,2 P 2,0 P 2,1 Training Hidden Layer example P 1,0 HErr 1,0 =ErrW 2 col(0) P 1,1 HErr 1,1 =ErrW 2 col(1) P 1,2 HErr 1,2 =ErrW 2 col(2) P 0,0 HErr 0,0 =HErr 1 W 1 col(0) P 0,1 HErr 0,1 =HErr 1 W 1 col(1) P 0,2 HErr 0,2 =HErr 1 W 1 col(2) P 0,3 HErr 0,3 =HErr 1 W 1 col(3) 1.0 P 2,0 Err 0 = d 0 – o 0 P 2,1 Err 1 = d 1 – o 1 I0I0 I1I1 I2I2 1.0