errors and what to do what to do about errors
play

Errors, and What to Do What to Do About Errors - PowerPoint PPT Presentation

Error-Driven Classifica)on CS 23: Ar)ficial Intelligence Perceptrons 10/29/2015 [These slides were created by Dan Klein and Pieter Abbeel for CS188


  1. Error-­‑Driven ¡Classifica)on ¡ CS ¡23: ¡Ar)ficial ¡Intelligence ¡ ¡ Perceptrons ¡ 10/29/2015 ¡ [These ¡slides ¡were ¡created ¡by ¡Dan ¡Klein ¡and ¡Pieter ¡Abbeel ¡for ¡CS188 ¡Intro ¡to ¡AI ¡at ¡UC ¡Berkeley. ¡ ¡All ¡CS188 ¡materials ¡are ¡available ¡at ¡hNp://ai.berkeley.edu.] ¡ Errors, ¡and ¡What ¡to ¡Do ¡ What ¡to ¡Do ¡About ¡Errors ¡ § Problem: ¡there’s ¡s)ll ¡spam ¡in ¡your ¡inbox ¡ § Examples ¡of ¡errors ¡ § Need ¡more ¡features ¡– ¡words ¡aren’t ¡enough! ¡ Dear GlobalSCAPE Customer, GlobalSCAPE has partnered with ScanSoft to offer you the § Have ¡you ¡emailed ¡the ¡sender ¡before? ¡ latest version of OmniPage Pro, for just $99.99* - the § Have ¡1M ¡other ¡people ¡just ¡goNen ¡the ¡same ¡email? ¡ regular list price is $499! The most common question we've received about this offer is - Is this genuine? We would like § Is ¡the ¡sending ¡informa)on ¡consistent? ¡ ¡ to assure you that this offer is authorized by ScanSoft, is genuine and valid. You can get the . . . § Is ¡the ¡email ¡in ¡ALL ¡CAPS? ¡ § Do ¡inline ¡URLs ¡point ¡where ¡they ¡say ¡they ¡point? ¡ . . . To receive your $30 Amazon.com promotional certificate, click through to § Does ¡the ¡email ¡address ¡you ¡by ¡(your) ¡name? ¡ http://www.amazon.com/apparel and see the prominent link for the $30 offer. All details are there. We hope you enjoyed receiving this message. However, § Naïve ¡Bayes ¡models ¡can ¡incorporate ¡a ¡variety ¡of ¡features, ¡but ¡tend ¡to ¡do ¡ if you'd rather not receive future e-mails announcing new best ¡in ¡homogeneous ¡cases ¡(e.g. ¡all ¡features ¡are ¡word ¡occurrences) ¡ store launches, please click . . . 1

  2. Later ¡On… ¡ Linear ¡Classifiers ¡ Web ¡Search ¡ Decision ¡Problems ¡ Feature ¡Vectors ¡ Some ¡(Simplified) ¡Biology ¡ § Very ¡loose ¡inspira)on: ¡human ¡neurons ¡ Hello, SPAM ¡ # free : 2 YOUR_NAME : 0 Do you want free printr or ¡ MISSPELLED : 2 cartriges? Why pay more FROM_FRIEND : 0 when you can get them + ¡ ... ABSOLUTELY FREE! Just PIXEL-7,12 : 1 “2” ¡ PIXEL-7,13 : 0 ... NUM_LOOPS : 1 ... 2

  3. Linear ¡Classifiers ¡ Weights ¡ § Binary ¡case: ¡compare ¡features ¡to ¡a ¡weight ¡vector ¡ § Inputs ¡are ¡feature ¡values ¡ § Learning: ¡figure ¡out ¡the ¡weight ¡vector ¡from ¡examples ¡ § Each ¡feature ¡has ¡a ¡weight ¡ § Sum ¡is ¡the ¡ac)va)on ¡ # free : 4 YOUR_NAME :-1 MISSPELLED : 1 # free : 2 YOUR_NAME : 0 FROM_FRIEND :-3 MISSPELLED : 2 ... FROM_FRIEND : 0 ... § If ¡the ¡ac)va)on ¡is: ¡ w 1 f 1 § Posi)ve, ¡output ¡+1 ¡ w 2 Σ # free : 0 >0? f 2 YOUR_NAME : 1 w 3 MISSPELLED : 1 § Nega)ve, ¡output ¡-­‑1 ¡ Dot product positive f 3 FROM_FRIEND : 1 means the positive class ... Decision ¡Rules ¡ Binary ¡Decision ¡Rule ¡ § 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 0 ... -­‑1 ¡= ¡HAM ¡ 0 1 free ¡ 3

  4. 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 ¡ Learning: ¡Binary ¡Perceptron ¡ Examples: ¡Perceptron ¡ § Start ¡with ¡weights ¡= ¡0 ¡ § Separable ¡Case ¡ § 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 ¡subtrac)ng ¡the ¡feature ¡ vector. ¡Subtract ¡if ¡y* ¡is ¡-­‑1. ¡ 4

  5. Mul)class ¡Decision ¡Rule ¡ Learning: ¡Mul)class ¡Perceptron ¡ § Start ¡with ¡all ¡weights ¡= ¡0 ¡ § If ¡we ¡have ¡mul)ple ¡classes: ¡ § Pick ¡up ¡training ¡examples ¡one ¡by ¡one ¡ § A ¡weight ¡vector ¡for ¡each ¡class: ¡ § Predict ¡with ¡current ¡weights ¡ § Score ¡(ac)va)on) ¡of ¡a ¡class ¡y: ¡ § If ¡correct, ¡no ¡change! ¡ § If ¡wrong: ¡lower ¡score ¡of ¡wrong ¡answer, ¡ raise ¡score ¡of ¡right ¡answer ¡ § Predic)on ¡highest ¡score ¡wins ¡ Binary ¡= ¡mul,class ¡where ¡the ¡nega,ve ¡class ¡has ¡weight ¡zero ¡ Example: ¡Mul)class ¡Perceptron ¡ Proper)es ¡of ¡Perceptrons ¡ Separable ¡ “win ¡the ¡vote” ¡ § Separability: ¡true ¡if ¡some ¡parameters ¡get ¡the ¡training ¡set ¡ perfectly ¡correct ¡ “win ¡the ¡elec)on” ¡ § Convergence: ¡if ¡the ¡training ¡is ¡separable, ¡perceptron ¡will ¡ “win ¡the ¡game” ¡ eventually ¡converge ¡(binary ¡case) ¡ § Mistake ¡Bound: ¡the ¡maximum ¡number ¡of ¡mistakes ¡(binary ¡ Non-­‑Separable ¡ case) ¡related ¡to ¡the ¡ margin ¡or ¡degree ¡of ¡separability ¡ BIAS : 1 BIAS : 0 BIAS : 0 win : 0 win : 0 win : 0 game : 0 game : 0 game : 0 vote : 0 vote : 0 vote : 0 the : 0 the : 0 the : 0 ... ... ... 5

  6. Examples: ¡Perceptron ¡ Improving ¡the ¡Perceptron ¡ § Non-­‑Separable ¡Case ¡ Problems ¡with ¡the ¡Perceptron ¡ Fixing ¡the ¡Perceptron ¡ § Noise: ¡if ¡the ¡data ¡isn’t ¡separable, ¡ § Idea: ¡adjust ¡the ¡weight ¡update ¡to ¡mi)gate ¡these ¡effects ¡ weights ¡might ¡thrash ¡ § Averaging ¡weight ¡vectors ¡over ¡)me ¡ § MIRA*: ¡choose ¡an ¡update ¡size ¡that ¡fixes ¡the ¡current ¡ can ¡help ¡(averaged ¡perceptron) ¡ mistake… ¡ § … ¡but, ¡minimizes ¡the ¡change ¡to ¡w ¡ § Mediocre ¡generaliza)on: ¡finds ¡a ¡ “barely” ¡separa)ng ¡solu)on ¡ § Overtraining: ¡test ¡/ ¡held-­‑out ¡ accuracy ¡usually ¡rises, ¡then ¡falls ¡ § Overtraining ¡is ¡a ¡kind ¡of ¡overfinng ¡ § The ¡+1 ¡helps ¡to ¡generalize ¡ * ¡Margin ¡Infused ¡Relaxed ¡Algorithm ¡ 6

  7. Minimum ¡Correc)ng ¡Update ¡ Maximum ¡Step ¡Size ¡ § In ¡prac)ce, ¡it’s ¡also ¡bad ¡to ¡make ¡updates ¡that ¡are ¡too ¡large ¡ § Example ¡may ¡be ¡labeled ¡incorrectly ¡ § You ¡may ¡not ¡have ¡enough ¡features ¡ § Solu)on: ¡cap ¡the ¡maximum ¡possible ¡value ¡of ¡ τ ¡with ¡some ¡ constant ¡C ¡ § Corresponds ¡to ¡an ¡op)miza)on ¡that ¡assumes ¡non-­‑separable ¡data ¡ § Usually ¡converges ¡faster ¡than ¡perceptron ¡ § Usually ¡beNer, ¡especially ¡on ¡noisy ¡data ¡ min ¡not ¡ τ =0, ¡or ¡would ¡not ¡have ¡ ¡ made ¡an ¡error, ¡so ¡min ¡will ¡be ¡ where ¡equality ¡holds ¡ Linear ¡Separators ¡ Support ¡Vector ¡Machines ¡ § Maximizing ¡the ¡margin: ¡good ¡according ¡to ¡intui)on, ¡theory, ¡prac)ce ¡ § Which ¡of ¡these ¡linear ¡separators ¡is ¡op)mal? ¡ ¡ § Only ¡support ¡vectors ¡maNer; ¡other ¡training ¡examples ¡are ¡ignorable ¡ ¡ § Support ¡vector ¡machines ¡(SVMs) ¡find ¡the ¡separator ¡with ¡max ¡margin ¡ § Basically, ¡SVMs ¡are ¡MIRA ¡where ¡you ¡op)mize ¡over ¡all ¡examples ¡at ¡once ¡ MIRA SVM 7

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend