1 / 80

Variables

“To be is to be the value of a variable .” - William Quine. Variables. Announcements. Pset 1 and prog 1 were due yesterday Pset 2 and prog 2 are going out today Tiny (intro) email backlog Probability Review is… TBA still

farren
Télécharger la présentation

Variables

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. “To be is to be the value of a variable.” - William Quine Variables

  2. Announcements • Pset 1 and prog 1 were due yesterday • Pset 2 and prog 2 are going out today • Tiny (intro) email backlog • Probability Review is… TBA still • Mistake on Alpha / Beta agent algorithm

  3. Alpha Beta Pruning defminiMax(self, node, depth, alpha, beta, isMax): ifnode.isTerminal(): ifisMaxreturnnode.utility() return–node.utility() ifdepth == 0: returnself.getHeuristic(node) ifisMax: foraction innode.getLegalActions(): child = node.getSuccessorState(action) value = miniMax(child, depth -1, alpha, beta, notisMax) alpha = max(alpha, value) ifbeta <= alpha: break returnalpha else: foraction in node.getLegalActions(): child = node.getSuccessorState(action) value = self.miniMax(child, depth -1, alpha, beta, notisMax) beta = min(value, beta) ifbeta <= alpha: break returnbeta returnnode.utility()

  4. Programming Assignment Time

  5. Programming Assignment Time Consider asking for help. Email your TA (or rock on)

  6. Problem Set Question Time

  7. Problem Set Question Time Total: 28 Hours / Student Ideal: 26 Hours / Student Units: 4.2 unit class 

  8. Homework Preference

  9. Driverless Car Important Algo. Easy to Visualize Less Time Driverless Car

  10. Search Machine Learning CS221 Variable Based

  11. Search Machine Learning CS221 Variable Based

  12. Image Segmentation

  13. Image Segmentation Claire Chris Home

  14. Image Segmentation

  15. Image Segmentation

  16. Motivating Example

  17. Motivating Example

  18. CSPs Commutatively: the order of application of actions has no effect on outcome

  19. CSPs

  20. CSPs Interesting in their own right Introduction to variable based models Inference is very similar to … [super secret stuff]

  21. CSPs • Formalization • Inference • Search • Improved Search • Arc Consistency • Graph Structure • Genetic Algorithms • Weighted CSPs • Image Segmentation

  22. The AI Pipeline Real World Problem Model the problem Formal Problem Apply an Algorithm Evaluate Solution

  23. Formally

  24. Factor Graphs

  25. Types of Domains

  26. Constraints

  27. Example: Map Coloring VariablesWA, NT, Q, NSW, V, SA, T DomainsDi = {red,green,blue} Constraints: adjacent regions must have different colors e.g., WA ≠ NT, or (WA,NT) in {(red,green),(red,blue),(green,red), (green,blue),(blue,red),(blue,green)}

  28. Example: Crypto Variables: F T U W R O X1 X2 X3 Domains: {0,1,2,3,4,5,6,7,8,9} Constraints: • Alldiff(F,T,U,W,R,O) • O + O = R + 10 ·X1 • X1 + W + W = U + 10 ·X2 • X2 + T + T = O + 10 · X3 • X3 = F, T ≠ 0, F≠0 CS 3243 - Constraint Satisfaction

  29. Example: Student Seats Go!

  30. The AI Pipeline Real World Problem Model the problem Formal Problem Apply an Algorithm Evaluate Solution

  31. Inference 1. Search 2. Constraint Propagation

  32. Example 2: Map Coloring VariablesWA, NT, Q, NSW, V, SA, T DomainsDi = {red,green,blue} Constraints: adjacent regions must have different colors e.g., WA ≠ NT, or (WA,NT) in {(red,green),(red,blue),(green,red), (green,blue),(blue,red),(blue,green)}

  33. Example 2: Map Coloring Solutions are complete and consistent assignments, e.g., WA = red, NT = green,Q = red,NSW = green,V = red,SA = blue,T = green

  34. Example 2: Map Coloring Binary CSP: each constraint relates two variables Constraint graph: nodes are variables, arcs are constraints

  35. Inference 1. Search 2. Constraint Propagation

  36. Search CS 3243 - Constraint Satisfaction

  37. Search

  38. Search

  39. Search

  40. Improved Search General-purpose methods can give huge gains in speed: • Which variable should be assigned next? • In what order should its values be tried? • Can we detect inevitable failure early?

  41. Most Constrained Variable Choose the variable with the fewest legal values a.k.a. minimum remaining values (MRV) heuristic

  42. Most Constraining Variable Tie-breaker among most constrained variables Choose the variable with the most constraints on remaining variables

  43. Least Constraining Assignment Given a variable, choose the assignment that rules out the fewest values in the remaining variables Fun fact: Combining these heuristics makes 1000 queens feasible

  44. Inference 1. Search 2. Constraint Propagation

More Related