Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 416 Artificial Intelligence Lecture 21 Making Complex Decisions Chapter 17 Lecture 21 Making Complex Decisions Chapter 17.

Similar presentations


Presentation on theme: "CS 416 Artificial Intelligence Lecture 21 Making Complex Decisions Chapter 17 Lecture 21 Making Complex Decisions Chapter 17."— Presentation transcript:

1 CS 416 Artificial Intelligence Lecture 21 Making Complex Decisions Chapter 17 Lecture 21 Making Complex Decisions Chapter 17

2 Game Theory Multiagent games with simultaneous moves First, study games with one moveFirst, study games with one move –bankruptcy proceedings –auctions –economics –war gaming Multiagent games with simultaneous moves First, study games with one moveFirst, study games with one move –bankruptcy proceedings –auctions –economics –war gaming

3 Definition of a game The playersThe players The actionsThe actions The payoff matrixThe payoff matrix –provides the utility to each player for each combination of actions The playersThe players The actionsThe actions The payoff matrixThe payoff matrix –provides the utility to each player for each combination of actions Two-finger Morra

4 Game theory strategies Strategy == policy (as in policy iteration) What do you do?What do you do? –pure strategy  you do the same thing all the time –mixed strategy  you rely on some randomized policy to select an action Strategy ProfileStrategy Profile –The assignment of strategies to players Strategy == policy (as in policy iteration) What do you do?What do you do? –pure strategy  you do the same thing all the time –mixed strategy  you rely on some randomized policy to select an action Strategy ProfileStrategy Profile –The assignment of strategies to players

5 Game theoretic solutions What’s a solution to a game? All players select a “rational” strategyAll players select a “rational” strategy Note that we’re not analyzing one particular game, but the outcomes that accumulate over a series of played gamesNote that we’re not analyzing one particular game, but the outcomes that accumulate over a series of played games What’s a solution to a game? All players select a “rational” strategyAll players select a “rational” strategy Note that we’re not analyzing one particular game, but the outcomes that accumulate over a series of played gamesNote that we’re not analyzing one particular game, but the outcomes that accumulate over a series of played games

6 Prisoner’s Dilemma Alice and Bob are caught red handed at the scene of a crime both are interrogated separately by the policeboth are interrogated separately by the police the penalty if they both confess is 5 years for eachthe penalty if they both confess is 5 years for each the penalty if they both refuse to confess is 1 year for eachthe penalty if they both refuse to confess is 1 year for each if one confesses and the other doesn’tif one confesses and the other doesn’t –the honest one (who confesses) gets 10 years –the liar gets 0 years Alice and Bob are caught red handed at the scene of a crime both are interrogated separately by the policeboth are interrogated separately by the police the penalty if they both confess is 5 years for eachthe penalty if they both confess is 5 years for each the penalty if they both refuse to confess is 1 year for eachthe penalty if they both refuse to confess is 1 year for each if one confesses and the other doesn’tif one confesses and the other doesn’t –the honest one (who confesses) gets 10 years –the liar gets 0 years What do you do to act selfishly?

7 Prisoner’s dilemma payoff matrix confess

8 Prisoner’s dilemma strategy Alice’s Strategy If Bob testifiesIf Bob testifies –best option is to testify (-5) If Bob confessesIf Bob confesses –best options is to testify (0) Alice’s Strategy If Bob testifiesIf Bob testifies –best option is to testify (-5) If Bob confessesIf Bob confesses –best options is to testify (0) testifying is a dominant strategy confess

9 Prisoner’s dilemma strategy Bob’s Strategy If Alice testifiesIf Alice testifies –best option is to testify (-5) If Alice confessesIf Alice confesses –best options is to testify (0) Bob’s Strategy If Alice testifiesIf Alice testifies –best option is to testify (-5) If Alice confessesIf Alice confesses –best options is to testify (0) testifying is a dominant strategy confess

10 Rationality Both players seem to have clear strategies Both testifyBoth testify –game outcome would be (-5, -5) Both players seem to have clear strategies Both testifyBoth testify –game outcome would be (-5, -5)

11 Dominance of strategies Comparing strategies Strategy s can strongly dominate s’Strategy s can strongly dominate s’ –the outcome of s is always better than the outcome of s’ no matter what the other player does  testifying strongly dominates confessing for Bob and Alice Strategy s can weakly dominate s’Strategy s can weakly dominate s’ –the outcome of s is better than the outcome of s’ on at least one action of the opponent and no worse on others Comparing strategies Strategy s can strongly dominate s’Strategy s can strongly dominate s’ –the outcome of s is always better than the outcome of s’ no matter what the other player does  testifying strongly dominates confessing for Bob and Alice Strategy s can weakly dominate s’Strategy s can weakly dominate s’ –the outcome of s is better than the outcome of s’ on at least one action of the opponent and no worse on others

12 Pareto Optimal Pareto optimality comes from economics An outcome can be Pareto optimalAn outcome can be Pareto optimal –textbook: no alternative outcome that all players would prefer –I prefer: the best that could be accomplished without disadvantaging at least one group Pareto optimality comes from economics An outcome can be Pareto optimalAn outcome can be Pareto optimal –textbook: no alternative outcome that all players would prefer –I prefer: the best that could be accomplished without disadvantaging at least one group Is the testify outcome (-5, -5) Pareto Optimal?

13 Is (-5, -5) Pareto Optimal? Is there an outcome that improves outcome without disadvantaging any group? How about (-1, -1) from (confess, confess)? confess

14 Dominant strategy equilibrium (-5, -5) represents a dominant strategy equilibrium neither player has an incentive to divert from dominant strategyneither player has an incentive to divert from dominant strategy –If Alice assumes Bob executes same strategy as he is now, she will only lose more by switching  likewise for Bob Imagine this as a local optimum in outcome spaceImagine this as a local optimum in outcome space –each dimension of outcome space is dimension of a player’s choice –any movement from dominant strategy equilibrium in this space results in worse outcomes (-5, -5) represents a dominant strategy equilibrium neither player has an incentive to divert from dominant strategyneither player has an incentive to divert from dominant strategy –If Alice assumes Bob executes same strategy as he is now, she will only lose more by switching  likewise for Bob Imagine this as a local optimum in outcome spaceImagine this as a local optimum in outcome space –each dimension of outcome space is dimension of a player’s choice –any movement from dominant strategy equilibrium in this space results in worse outcomes

15 Thus the dilemma… Now we see the problem Outcome (-5, -5) is Pareto dominated by outcome (-1, -1)Outcome (-5, -5) is Pareto dominated by outcome (-1, -1) –To achieve Pareto optimal outcome requires divergence from local optimum at strategy equilibrium Tough situation… Pareto optimal would be nice, but it is unlikely because each player risks losing moreTough situation… Pareto optimal would be nice, but it is unlikely because each player risks losing more Now we see the problem Outcome (-5, -5) is Pareto dominated by outcome (-1, -1)Outcome (-5, -5) is Pareto dominated by outcome (-1, -1) –To achieve Pareto optimal outcome requires divergence from local optimum at strategy equilibrium Tough situation… Pareto optimal would be nice, but it is unlikely because each player risks losing moreTough situation… Pareto optimal would be nice, but it is unlikely because each player risks losing more

16 Nash Equilibrium John Nash studied game theory in 1950s Proved that every game has an equilibriumProved that every game has an equilibrium –If there is a set of strategies with the property that no player can benefit by changing her strategy while the other players keep their strategies unchanged, then that set of strategies and the corresponding payoffs constitute the Nash Equilibrium All dominant strategies are Nash equilibriaAll dominant strategies are Nash equilibria John Nash studied game theory in 1950s Proved that every game has an equilibriumProved that every game has an equilibrium –If there is a set of strategies with the property that no player can benefit by changing her strategy while the other players keep their strategies unchanged, then that set of strategies and the corresponding payoffs constitute the Nash Equilibrium All dominant strategies are Nash equilibriaAll dominant strategies are Nash equilibria

17 Another game Acme: Hardware manufacturer chooses between CD and DVD format for next game platformAcme: Hardware manufacturer chooses between CD and DVD format for next game platform Best: Software manufacturer chooses between CD and DVD format for next titleBest: Software manufacturer chooses between CD and DVD format for next title Acme: Hardware manufacturer chooses between CD and DVD format for next game platformAcme: Hardware manufacturer chooses between CD and DVD format for next game platform Best: Software manufacturer chooses between CD and DVD format for next titleBest: Software manufacturer chooses between CD and DVD format for next title

18 No dominant strategy Verify that there is no dominant strategyVerify that there is no dominant strategy

19 Yet two Nash equilibria exist Outcome 1: (DVD, DVD)… (9, 9) Outcome 2: (CD, CD)… (5, 5) If either player unilaterally changes strategy, that player will be worse off Outcome 1: (DVD, DVD)… (9, 9) Outcome 2: (CD, CD)… (5, 5) If either player unilaterally changes strategy, that player will be worse off

20 We still have a problem Two Nash equlibria, but which is selected? If players fail to select same strategy, both will loseIf players fail to select same strategy, both will lose –they could “agree” to select the Pareto optimal solution  that seems reasonable –they could coordinate Two Nash equlibria, but which is selected? If players fail to select same strategy, both will loseIf players fail to select same strategy, both will lose –they could “agree” to select the Pareto optimal solution  that seems reasonable –they could coordinate

21 Zero-sum games Intro Payoffs in each cell of payoff matrix sum to 0Payoffs in each cell of payoff matrix sum to 0 The Nash equilibrium in such cases may be a mixed strategyThe Nash equilibrium in such cases may be a mixed strategyIntro Payoffs in each cell of payoff matrix sum to 0Payoffs in each cell of payoff matrix sum to 0 The Nash equilibrium in such cases may be a mixed strategyThe Nash equilibrium in such cases may be a mixed strategy

22 Zero-sum games Payoffs in each cell sum to zero Two-finger Morra Two players (Odd and Even)Two players (Odd and Even) ActionAction –Each player simultaneously displays one or two fingers EvaluationEvaluation –f = total number of fingers  if f == odd, Even gives f dollars go to Odd  if f == even, Odd gives f dollars go to Even Payoffs in each cell sum to zero Two-finger Morra Two players (Odd and Even)Two players (Odd and Even) ActionAction –Each player simultaneously displays one or two fingers EvaluationEvaluation –f = total number of fingers  if f == odd, Even gives f dollars go to Odd  if f == even, Odd gives f dollars go to Even

23 Optimal strategy von Neumann (1928) developed optimal mixed strategy for two-player, zero-sum games We need only keep track of what one player wins (because we then know what other player loses)We need only keep track of what one player wins (because we then know what other player loses) –Let’s pick the Even player –assume this player wishes to maximize Maximin technique (note we studied minimax in Ch. 6)Maximin technique (note we studied minimax in Ch. 6) –make game a turn-taking game and analyze von Neumann (1928) developed optimal mixed strategy for two-player, zero-sum games We need only keep track of what one player wins (because we then know what other player loses)We need only keep track of what one player wins (because we then know what other player loses) –Let’s pick the Even player –assume this player wishes to maximize Maximin technique (note we studied minimax in Ch. 6)Maximin technique (note we studied minimax in Ch. 6) –make game a turn-taking game and analyze

24 Maximin Change the rules of Morra for analysis Force Even to reveal strategy firstForce Even to reveal strategy first –apply maximin algorithm –Odd has an advantage and thus the outcome of the game is Even’s worst case and Even might do better in real game The worst Even can do is to lose $3 in this modified gameThe worst Even can do is to lose $3 in this modified game Change the rules of Morra for analysis Force Even to reveal strategy firstForce Even to reveal strategy first –apply maximin algorithm –Odd has an advantage and thus the outcome of the game is Even’s worst case and Even might do better in real game The worst Even can do is to lose $3 in this modified gameThe worst Even can do is to lose $3 in this modified game

25 Maximin Force Odd to reveal strategy first –Apply minimax algorithm  If Odd selects 1, loss will be $2  If Odd selects 2, loss will be $4 –The worst Odd can do is to lose $2 in this modified game Force Odd to reveal strategy first –Apply minimax algorithm  If Odd selects 1, loss will be $2  If Odd selects 2, loss will be $4 –The worst Odd can do is to lose $2 in this modified game

26 Combining two games Even’s combined utility Even’s winnings will be somewhere betweenEven’s winnings will be somewhere between –the best case (MAX) in the game modified to its disadvantage –the worst case (MIN) in the game modified to its advantage EvenFirst_Utility ≤ Even’s_Utility ≤ OddFirst_UtilitEvenFirst_Utility ≤ Even’s_Utility ≤ OddFirst_Utilit -3 ≤ Even’s_Utility ≤ 2 -3 ≤ Even’s_Utility ≤ 2 Even’s combined utility Even’s winnings will be somewhere betweenEven’s winnings will be somewhere between –the best case (MAX) in the game modified to its disadvantage –the worst case (MIN) in the game modified to its advantage EvenFirst_Utility ≤ Even’s_Utility ≤ OddFirst_UtilitEvenFirst_Utility ≤ Even’s_Utility ≤ OddFirst_Utilit -3 ≤ Even’s_Utility ≤ 2 -3 ≤ Even’s_Utility ≤ 2

27 Considering mixed strategies Mixed strategyMixed strategy –select one finger with prob: p –select two fingers with prob: 1 – p If one player reveals strategy first, second player will always use a pure strategyIf one player reveals strategy first, second player will always use a pure strategy –expected utility of a mixed strategy  U1 = p * u one + (1-p) u two –expected utility of a pure strategy  U2 = max (u one, u two ) –U2 is always greater than U1 when your opponent reveals action early Mixed strategyMixed strategy –select one finger with prob: p –select two fingers with prob: 1 – p If one player reveals strategy first, second player will always use a pure strategyIf one player reveals strategy first, second player will always use a pure strategy –expected utility of a mixed strategy  U1 = p * u one + (1-p) u two –expected utility of a pure strategy  U2 = max (u one, u two ) –U2 is always greater than U1 when your opponent reveals action early

28 Modeling as a game tree Because the second player will always use a fixed strategy… Still pretending Even goes firstStill pretending Even goes first Because the second player will always use a fixed strategy… Still pretending Even goes firstStill pretending Even goes first - - - - - Typo in book -

29 What is outcome of this game? Player Odd has a choice Always pick the option that minimizes utility to EvenAlways pick the option that minimizes utility to Even Represent two choices as functions of pRepresent two choices as functions of p Odd picks line that is lowest (dark part on figure)Odd picks line that is lowest (dark part on figure) Even maximizes utility by choosing p to be where lines crossEven maximizes utility by choosing p to be where lines cross –5p – 3 = 4 – 7p p = 7/12 => E utility = -1/12 Player Odd has a choice Always pick the option that minimizes utility to EvenAlways pick the option that minimizes utility to Even Represent two choices as functions of pRepresent two choices as functions of p Odd picks line that is lowest (dark part on figure)Odd picks line that is lowest (dark part on figure) Even maximizes utility by choosing p to be where lines crossEven maximizes utility by choosing p to be where lines cross –5p – 3 = 4 – 7p p = 7/12 => E utility = -1/12

30 Pretend Odd must go first Even’s outcome decided by pure strategy (dependent on q) Even will always pick maximum of two choicesEven will always pick maximum of two choices Odd will minimize the maximum of two choicesOdd will minimize the maximum of two choices –Odd chooses intersection point –5q – 3 = 4 – 7q q = 7/12 => E utility = -1/12 Even’s outcome decided by pure strategy (dependent on q) Even will always pick maximum of two choicesEven will always pick maximum of two choices Odd will minimize the maximum of two choicesOdd will minimize the maximum of two choices –Odd chooses intersection point –5q – 3 = 4 – 7q q = 7/12 => E utility = -1/12

31 Final results Both players use same mixed strategy –p one = 7/12 –p two = 5/12 –Outcome of the game is -1/12 to Even Both players use same mixed strategy –p one = 7/12 –p two = 5/12 –Outcome of the game is -1/12 to Even

32 Generalization Two players with n action choices mixed strategy is not as simple as p, 1-pmixed strategy is not as simple as p, 1-p –it is (p 1, p 2, …, p n-1, 1-(p 1 +p 2 +…+p n-1 )) Solving for optimal p vector requires finding optimal point in (n-1)- dimensional spaceSolving for optimal p vector requires finding optimal point in (n-1)- dimensional space –lines become hyperplanes –some hyperplanes will be clearly worse for all p –find intersection among remaining hyperplanes –linear programming can solve this problem Two players with n action choices mixed strategy is not as simple as p, 1-pmixed strategy is not as simple as p, 1-p –it is (p 1, p 2, …, p n-1, 1-(p 1 +p 2 +…+p n-1 )) Solving for optimal p vector requires finding optimal point in (n-1)- dimensional spaceSolving for optimal p vector requires finding optimal point in (n-1)- dimensional space –lines become hyperplanes –some hyperplanes will be clearly worse for all p –find intersection among remaining hyperplanes –linear programming can solve this problem

33 Repeated games Imagine same game played multiple times payoffs accumulate for each playerpayoffs accumulate for each player optimal strategy is a function of game historyoptimal strategy is a function of game history –must select optimal action for each possible game history StrategiesStrategies –perpetual punishment  cross me once and I’ll take us both down forever –tit for tat  cross me once and I’ll cross you the subsequent move Imagine same game played multiple times payoffs accumulate for each playerpayoffs accumulate for each player optimal strategy is a function of game historyoptimal strategy is a function of game history –must select optimal action for each possible game history StrategiesStrategies –perpetual punishment  cross me once and I’ll take us both down forever –tit for tat  cross me once and I’ll cross you the subsequent move

34 The design of games Let’s invert the strategy selection process to design fair/effective games Tragedy of the commonsTragedy of the commons –individual farmers bring their livestock to the town commons to graze –commons is destroyed and all experience negative utility –all behaved rationally – refraining would not have saved the commons as someone else would eat it  Externalities are a way to place a value on changes in global utility  Power utilities pay for the utility they deprive neighboring communities (yet another Nobel prize in Econ for this – Coase (prof at UVa)) Let’s invert the strategy selection process to design fair/effective games Tragedy of the commonsTragedy of the commons –individual farmers bring their livestock to the town commons to graze –commons is destroyed and all experience negative utility –all behaved rationally – refraining would not have saved the commons as someone else would eat it  Externalities are a way to place a value on changes in global utility  Power utilities pay for the utility they deprive neighboring communities (yet another Nobel prize in Econ for this – Coase (prof at UVa))

35 Auctions English AuctionEnglish Auction –auctioneer incrementally raises bid price until one bidder remains  bidder gets the item at the highest price of another bidder plus the increment (perhaps the highest bidder would have spent more?)  strategy is simple… keep bidding until price is higher than utility  strategy of other bidders is irrelevant English AuctionEnglish Auction –auctioneer incrementally raises bid price until one bidder remains  bidder gets the item at the highest price of another bidder plus the increment (perhaps the highest bidder would have spent more?)  strategy is simple… keep bidding until price is higher than utility  strategy of other bidders is irrelevant

36 Auctions Sealed bid auctionSealed bid auction –place your bid in an envelope and highest bid is selected  say your highest bid is v  say you believe the highest competing bid is b  bid min (v, b +  )  player with highest value on good may not win the good and players must contemplate other player’s values Sealed bid auctionSealed bid auction –place your bid in an envelope and highest bid is selected  say your highest bid is v  say you believe the highest competing bid is b  bid min (v, b +  )  player with highest value on good may not win the good and players must contemplate other player’s values

37 Auctions Vickery Auction (A sealed bid auction)Vickery Auction (A sealed bid auction) –Winner pays the price of the second-highest bid –Dominant strategy is to bid what item is worth to you Vickery Auction (A sealed bid auction)Vickery Auction (A sealed bid auction) –Winner pays the price of the second-highest bid –Dominant strategy is to bid what item is worth to you

38 Auctions These auction algorithms can find their way into computer- controlled systemsThese auction algorithms can find their way into computer- controlled systems –Networking  Routers  Ethernet –Thermostat control in offices (Xerox PARC) These auction algorithms can find their way into computer- controlled systemsThese auction algorithms can find their way into computer- controlled systems –Networking  Routers  Ethernet –Thermostat control in offices (Xerox PARC)

39 Neural Networks Read Section 20.5 Small program and homework assignment Read Section 20.5 Small program and homework assignment

40 Model of Neurons Multiple inputs/dendrites (~10,000!!!)Multiple inputs/dendrites (~10,000!!!) Cell body/soma performs computationCell body/soma performs computation Single output/axonSingle output/axon Computation is typically modeled as linearComputation is typically modeled as linear –  change in input corresponds to k  change in output (not k  2 or sin  …) Multiple inputs/dendrites (~10,000!!!)Multiple inputs/dendrites (~10,000!!!) Cell body/soma performs computationCell body/soma performs computation Single output/axonSingle output/axon Computation is typically modeled as linearComputation is typically modeled as linear –  change in input corresponds to k  change in output (not k  2 or sin  …)

41 Early History of Neural Nets Eons ago: Neurons are invented 1868: J. C. Maxwell studies feedback mechanisms1868: J. C. Maxwell studies feedback mechanisms 1943: McCulloch-Pitts Neurons1943: McCulloch-Pitts Neurons 1949: Hebb indicates biological mechanism1949: Hebb indicates biological mechanism 1962: Rosenblatt’s Perceptron1962: Rosenblatt’s Perceptron 1969: Minsky and Papert decompose perceptrons1969: Minsky and Papert decompose perceptrons Eons ago: Neurons are invented 1868: J. C. Maxwell studies feedback mechanisms1868: J. C. Maxwell studies feedback mechanisms 1943: McCulloch-Pitts Neurons1943: McCulloch-Pitts Neurons 1949: Hebb indicates biological mechanism1949: Hebb indicates biological mechanism 1962: Rosenblatt’s Perceptron1962: Rosenblatt’s Perceptron 1969: Minsky and Papert decompose perceptrons1969: Minsky and Papert decompose perceptrons

42 McCulloch-Pitts Neurons One or two inputs to neuronOne or two inputs to neuron Inputs are multiplied by weightsInputs are multiplied by weights If sum of products exceeds a threshold, the neuron firesIf sum of products exceeds a threshold, the neuron fires One or two inputs to neuronOne or two inputs to neuron Inputs are multiplied by weightsInputs are multiplied by weights If sum of products exceeds a threshold, the neuron firesIf sum of products exceeds a threshold, the neuron fires

43 What can we model with these? -0.5 -1 Error in book

44 Perceptrons Each input is binary and has associated with it a weightEach input is binary and has associated with it a weight The sum of the inner product of the input and weights is calculatedThe sum of the inner product of the input and weights is calculated If this sum exceeds a threshold, the perceptron firesIf this sum exceeds a threshold, the perceptron fires Each input is binary and has associated with it a weightEach input is binary and has associated with it a weight The sum of the inner product of the input and weights is calculatedThe sum of the inner product of the input and weights is calculated If this sum exceeds a threshold, the perceptron firesIf this sum exceeds a threshold, the perceptron fires

45 Neuron thresholds (activation functions) It is desirable to have a differentiable activation function for automatic weight adjustmentIt is desirable to have a differentiable activation function for automatic weight adjustment http://www.csulb.edu/~cwallis/artificialn/History.htm

46 Hebbian Modification “When an axon of cell A is near enough to excite cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A’s efficiency, as one of the cells firing B, is increased” from Hebb’s 1949 The Organization of Behavior, p. 62 “When an axon of cell A is near enough to excite cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A’s efficiency, as one of the cells firing B, is increased” from Hebb’s 1949 The Organization of Behavior, p. 62

47 Error Correction Only updates weights for non-zero inputs For positive inputs If the perceptron should have fired but did not, the weight is increasedIf the perceptron should have fired but did not, the weight is increased If the perceptron fired but should not have, the weight is decreasedIf the perceptron fired but should not have, the weight is decreased Only updates weights for non-zero inputs For positive inputs If the perceptron should have fired but did not, the weight is increasedIf the perceptron should have fired but did not, the weight is increased If the perceptron fired but should not have, the weight is decreasedIf the perceptron fired but should not have, the weight is decreased

48 Perceptron Example Example modified from “The Essence of Artificial Intelligence” by Alison CawseyExample modified from “The Essence of Artificial Intelligence” by Alison Cawsey Initialize all weights to 0.2Initialize all weights to 0.2 Let epsilon = 0.05 and threshold = 0.5Let epsilon = 0.05 and threshold = 0.5 Example modified from “The Essence of Artificial Intelligence” by Alison CawseyExample modified from “The Essence of Artificial Intelligence” by Alison Cawsey Initialize all weights to 0.2Initialize all weights to 0.2 Let epsilon = 0.05 and threshold = 0.5Let epsilon = 0.05 and threshold = 0.5

49 Perceptron Example First output is 1 since 0.2+0.2+0.2>0.5First output is 1 since 0.2+0.2+0.2>0.5 Should be 0, so weights with active connections are decremented by 0.05Should be 0, so weights with active connections are decremented by 0.05 First output is 1 since 0.2+0.2+0.2>0.5First output is 1 since 0.2+0.2+0.2>0.5 Should be 0, so weights with active connections are decremented by 0.05Should be 0, so weights with active connections are decremented by 0.05

50 Perceptron Example Next output is 0 since 0.15+0.15+0.2<=0.5Next output is 0 since 0.15+0.15+0.2<=0.5 Should be 1, so weights with active connections are incremented by 0.05Should be 1, so weights with active connections are incremented by 0.05 New weights work for Alison, Jeff, and GailNew weights work for Alison, Jeff, and Gail Next output is 0 since 0.15+0.15+0.2<=0.5Next output is 0 since 0.15+0.15+0.2<=0.5 Should be 1, so weights with active connections are incremented by 0.05Should be 1, so weights with active connections are incremented by 0.05 New weights work for Alison, Jeff, and GailNew weights work for Alison, Jeff, and Gail

51 Perceptron Example Output for Simon is 1 (0.2+0.25+0.15>0.5)Output for Simon is 1 (0.2+0.25+0.15>0.5) Should be 0, so weights with active connections are decremented by 0.05Should be 0, so weights with active connections are decremented by 0.05 Are we finished?Are we finished? Output for Simon is 1 (0.2+0.25+0.15>0.5)Output for Simon is 1 (0.2+0.25+0.15>0.5) Should be 0, so weights with active connections are decremented by 0.05Should be 0, so weights with active connections are decremented by 0.05 Are we finished?Are we finished?

52 Perceptron Example After processing all the examples again we get weights that work for all examplesAfter processing all the examples again we get weights that work for all examples What do these weights mean?What do these weights mean? In general, how often should we reprocess?In general, how often should we reprocess? After processing all the examples again we get weights that work for all examplesAfter processing all the examples again we get weights that work for all examples What do these weights mean?What do these weights mean? In general, how often should we reprocess?In general, how often should we reprocess?

53 Perceptrons are linear classifiers Consider a two-input neuron Two weights are “tuned” to fit the dataTwo weights are “tuned” to fit the data The neuron uses the equation w 1 * x 1 + w 2 * x 2 to fire or notThe neuron uses the equation w 1 * x 1 + w 2 * x 2 to fire or not –This is like the equation of a line mx + b - y Consider a two-input neuron Two weights are “tuned” to fit the dataTwo weights are “tuned” to fit the data The neuron uses the equation w 1 * x 1 + w 2 * x 2 to fire or notThe neuron uses the equation w 1 * x 1 + w 2 * x 2 to fire or not –This is like the equation of a line mx + b - y http://www.compapp.dcu.ie/~humphrys/Notes/Neural/single.neural.html

54 Linearly separable These single-layer perceptron networks can classify linearly separable systems

55 For homework Consider a system like XOR x 1 x 2 x 1 XOR x 2 110 011 101 110 Consider a system like XOR x 1 x 2 x 1 XOR x 2 110 011 101 110

56 Class Exercise Find w1, w2, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2Find w1, w2, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done Find w1, w2, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2Find w1, w2, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done

57 2 nd Class Exercise x3 = ~x1, x4 = ~x2x3 = ~x1, x4 = ~x2 Find w1, w2, w3, w4, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2Find w1, w2, w3, w4, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done x3 = ~x1, x4 = ~x2x3 = ~x1, x4 = ~x2 Find w1, w2, w3, w4, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2Find w1, w2, w3, w4, and theta such that Theta(x1*w1+x2*w2 )= x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done

58 3 rd Class Exercise Find w1, w2, and f() such that f(x1*w1+x2*w2) = x1 xor x2Find w1, w2, and f() such that f(x1*w1+x2*w2) = x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done Find w1, w2, and f() such that f(x1*w1+x2*w2) = x1 xor x2Find w1, w2, and f() such that f(x1*w1+x2*w2) = x1 xor x2 Or, prove that it can’t be doneOr, prove that it can’t be done


Download ppt "CS 416 Artificial Intelligence Lecture 21 Making Complex Decisions Chapter 17 Lecture 21 Making Complex Decisions Chapter 17."

Similar presentations


Ads by Google