CS 4/527: Artificial Intelligence

Slides:



Advertisements
Similar presentations
Classification Classification Examples
Advertisements

Linear Classifiers (perceptrons)
Data Mining Classification: Alternative Techniques
Support Vector Machines
CSCI 347 / CS 4206: Data Mining Module 07: Implementations Topic 03: Linear Models.
PERCEPTRON LEARNING David Kauchak CS 451 – Fall 2013.
CS Perceptrons1. 2 Basic Neuron CS Perceptrons3 Expanded Neuron.
Fuzzy Support Vector Machines (FSVMs) Weijia Wang, Huanren Zhang, Vijendra Purohit, Aditi Gupta.
x – independent variable (input)
CS 188: Artificial Intelligence Fall 2009
Prénom Nom Document Analysis: Linear Discrimination Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
CS 188: Artificial Intelligence Spring 2007 Lecture 19: Perceptrons 4/2/2007 Srini Narayanan – ICSI and UC Berkeley.
CES 514 – Data Mining Lecture 8 classification (contd…)
CS 188: Artificial Intelligence Fall 2009 Lecture 23: Perceptrons 11/17/2009 Dan Klein – UC Berkeley TexPoint fonts used in EMF. Read the TexPoint manual.
CSCI 347 / CS 4206: Data Mining Module 04: Algorithms Topic 06: Regression.
Online Learning Algorithms
Classification III Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
Support Vector Machines Piyush Kumar. Perceptrons revisited Class 1 : (+1) Class 2 : (-1) Is this unique?
SVM by Sequential Minimal Optimization (SMO)
CS 8751 ML & KDDSupport Vector Machines1 Support Vector Machines (SVMs) Learning mechanism based on linear programming Chooses a separating plane based.
ADVANCED CLASSIFICATION TECHNIQUES David Kauchak CS 159 – Fall 2014.
8/25/05 Cognitive Computations Software Tutorial Page 1 SNoW: Sparse Network of Winnows Presented by Nick Rizzolo.
Classification and Ranking Approaches to Discriminative Language Modeling for ASR Erinç Dikici, Murat Semerci, Murat Saraçlar, Ethem Alpaydın 報告者:郝柏翰 2013/01/28.
CSE 446 Perceptron Learning Winter 2012 Dan Weld Some slides from Carlos Guestrin, Luke Zettlemoyer.
Classification: Feature Vectors
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.6: Linear Models Rodney Nielsen Many of.
Classification: Feature Vectors Hello, Do you want free printr cartriges? Why pay more when you can get them ABSOLUTELY FREE! Just # free : 2 YOUR_NAME.
ADVANCED PERCEPTRON LEARNING David Kauchak CS 451 – Fall 2013.
Tony Jebara, Columbia University Advanced Machine Learning & Perception Instructor: Tony Jebara.
CISC667, F05, Lec22, Liao1 CISC 667 Intro to Bioinformatics (Fall 2005) Support Vector Machines I.
Ohad Hageby IDC Support Vector Machines & Kernel Machines IP Seminar 2008 IDC Herzliya.
Today’s Topics 11/10/15CS Fall 2015 (Shavlik©), Lecture 22, Week 101 Support Vector Machines (SVMs) Three Key Ideas –Max Margins –Allowing Misclassified.
CS 188: Artificial Intelligence Spring 2006 Lecture 12: Learning Theory 2/23/2006 Dan Klein – UC Berkeley Many slides from either Stuart Russell or Andrew.
CS 188: Artificial Intelligence Fall 2007 Lecture 25: Kernels 11/27/2007 Dan Klein – UC Berkeley.
CS 188: Artificial Intelligence Learning II: Linear Classification and Neural Networks Instructors: Stuart Russell and Pat Virtue University of California,
CSE 446 Logistic Regression Perceptron Learning Winter 2012 Dan Weld Some slides from Carlos Guestrin, Luke Zettlemoyer.
Giansalvo EXIN Cirrincione unit #4 Single-layer networks They directly compute linear discriminant functions using the TS without need of determining.
CS 188: Artificial Intelligence Fall 2008 Lecture 24: Perceptrons II 11/24/2008 Dan Klein – UC Berkeley 1.
Machine Learning: Ensemble Methods
PREDICT 422: Practical Machine Learning
Gradient descent David Kauchak CS 158 – Fall 2016.
Fun with Hyperplanes: Perceptrons, SVMs, and Friends
Large Margin classifiers
Lecture 18. Support Vector Machine (SVM)
Dan Roth Department of Computer and Information Science
Artificial Intelligence
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Approximating the MST Weight in Sublinear Time
Perceptrons Lirong Xia.
Announcements HW4 due today (11:59pm) HW5 out today (due 11/17 11:59pm)
Classification with Perceptrons Reading:
CS 188: Artificial Intelligence Fall 2008
Data Mining Lecture 11.
CS 188: Artificial Intelligence
An Introduction to Support Vector Machines
Linear Discriminators
Pattern Recognition CS479/679 Pattern Recognition Dr. George Bebis
CS 188: Artificial Intelligence
CAP 5636 – Advanced Artificial Intelligence
Large Scale Support Vector Machines
CSSE463: Image Recognition Day 14
CS480/680: Intro to ML Lecture 01: Perceptron 9/11/18 Yao-Liang Yu.
Support Vector Machines
CS 188: Artificial Intelligence Spring 2006
CS 188: Artificial Intelligence Fall 2008
Artificial Intelligence 9. Perceptron
CS 188: Artificial Intelligence
MIRA, SVM, k-NN Lirong Xia. MIRA, SVM, k-NN Lirong Xia.
Perceptrons Lirong Xia.
Introduction to Machine Learning
Presentation transcript:

CS 4/527: Artificial Intelligence Perceptrons Instructor: Jared Saia--- University of New Mexico [These slides were created by Dan Klein, Pieter Abbeel, Anca Dragan for CS188 Intro to AI at UC Berkeley. All CS188 materials are available at http://ai.berkeley.edu.]

Linear Classifiers

Feature Vectors SPAM or + “2” Hello, Do you want free printr cartriges? Why pay more when you can get them ABSOLUTELY FREE! Just # free : 2 YOUR_NAME : 0 MISSPELLED : 2 FROM_FRIEND : 0 ... SPAM or + PIXEL-7,12 : 1 PIXEL-7,13 : 0 ... NUM_LOOPS : 1 “2”

Linear Classifiers  Inputs are feature values Each feature has a weight Sum is the activation If the activation is: Positive, output +1 Negative, output -1 w1  f1 w2 >0? f2 w3 f3

Geometric Explanation # free : 4 YOUR_NAME :-1 MISSPELLED : 1 FROM_FRIEND :-3 ... # free : 2 YOUR_NAME : 0 MISSPELLED : 2 FROM_FRIEND : 0 ... # free : 0 YOUR_NAME : 1 MISSPELLED : 1 FROM_FRIEND : 1 ... Dot product positive means the positive class

Geometric Explanation In the space of feature vectors Examples are points Any weight vector is a hyperplane One side corresponds to Y=+1 Other corresponds to Y=-1 money 2 +1 = SPAM 1 BIAS : -3 free : 4 money : 2 ... -1 = HAM 1 free

Weight Updates

Learning: Binary Perceptron Start with weights = 0 For each training instance: Classify with current weights If correct (i.e., y=y*), no change! If wrong: adjust the weight vector http://isl.ira.uka.de/neuralNetCourse/2004/VL_11_5/Perceptron.html 8

Learning: Binary Perceptron Start with weights = 0 For each training instance: Classify with current weights If correct (i.e., y=y*), no change! If wrong: adjust the weight vector by adding or subtracting the feature vector. Subtract if y* is -1. http://isl.ira.uka.de/neuralNetCourse/2004/VL_11_5/Perceptron.html let’s say wf>0 y*=-1; now w<-w-f; new dot product is wf-ff; ff positive so we are subtracting 9

Examples: Perceptron Separable Case if your data is separable, then the perceptron will find a correct boundary note: many correct boundaries 10

Multiclass Decision Rule If we have multiple classes: A weight vector for each class: Score (activation) of a class y: Prediction highest score wins if vectors happen to be equal length, the decision boundaries bisect note relation to binary; e.g. our old w is really w+ minus w-; we used to check wf >0, here we check if w+ higher; connection to game trees: we simplified for zero sum by having on utility, but really in general we have one for each player Binary = multiclass where the negative class has weight zero 11

Learning: Multiclass Perceptron Start with all weights = 0 Pick up training examples one by one Predict with current weights If correct, no change! If wrong: lower score of wrong answer, raise score of right answer if wrong, e.g. predict + when it’s -; we used to change w by –f; now we add f to w- and subtract it from w+; overall w+ minus w- gets updated by 2f, so to make equivalence to binary work we’d have to do a 2f update. 12

Example: Multiclass Perceptron “win the vote” “win the election” “win the game” BIAS : 1 win : 0 game : 0 vote : 0 the : 0 ... BIAS : 0 win : 0 game : 0 vote : 0 the : 0 ... BIAS : 0 win : 0 game : 0 vote : 0 the : 0 ... 13

Show example from video Multiclass Example

Properties of Perceptrons Separable Separability: true if some parameters get the training set perfectly correct Convergence: if the training is separable, perceptron will eventually converge (binary case) Mistake Bound: the maximum number of mistakes (binary case) related to the margin or degree of separability Non-Separable k=number of features; delta^2=margin this bounds the running time too (since you stop when you make 0 mistakes so every run through has at least 1 mistake when you are still training) k = square of radius of ball containing data delta = margin separating data classes 15

Examples: Perceptron Non-Separable Case

Improving the Perceptron

Problems with the Perceptron Noise: if the data isn’t separable, weights might thrash Averaging weight vectors over time can help (averaged perceptron) Mediocre generalization: finds a “barely” separating solution Overtraining: test / held-out accuracy usually rises, then falls Overtraining is a kind of overfitting

Fixing the Perceptron Idea: adjust the weight update to mitigate these effects MIRA*: choose an update size that fixes the current mistake… … but, minimizes the change to w The +1 helps to generalize * Margin Infused Relaxed Algorithm

Minimum Correcting Update min not =0, or would not have made an error, so min will be where equality holds

Maximum Step Size In practice, it’s also bad to make updates that are too large Example may be labeled incorrectly You may not have enough features Solution: cap the maximum possible value of  with some constant C Corresponds to an optimization that assumes non-separable data Usually converges faster than perceptron Usually better, especially on noisy data

Linear Separators Which of these linear separators is optimal? 22

Support Vector Machines Maximizing the margin: good according to intuition, theory, practice Only support vectors matter; other training examples are ignorable Support vector machines (SVMs) find the separator with max margin Basically, SVMs are MIRA where you optimize over all examples at once MIRA SVM

Classification: Comparison Naïve Bayes Builds a model training data Gives prediction probabilities Strong assumptions about feature independence One pass through data (counting) Perceptrons / MIRA: Makes less assumptions about data Mistake-driven learning Multiple passes through data (prediction) Often more accurate