360 likes | 498 Views
Wrap-up First Unit Motivating Logic in AI. Exam #1. My general impression as I graded the exams: You understood the general idea(s) but not the specifics/details You were able to say things that made sense, but you couldn’t identify the key ideas that show that you GET IT. Exam #1.
E N D
Wrap-up First Unit Motivating Logic in AI
Exam #1 • My general impression as I graded the exams: • You understood the general idea(s) but not the specifics/details • You were able to say things that made sense, but you couldn’t identify the key ideas that show that you GET IT.
Exam #1 • Examples: • 1c – to explain why it is better than DFS you have to mention that it won’t fall into infinite loops • 2c – “They have info about the problem” What KIND of info? (This is important). • 3b – You have to talk about the children • 3e – you better define what alpha and beta are
Exam #1 • What is in the grade book. • Add up all your points • Add 2.5 • Multiply by 4/3 • This gives you an adjusted score out of 100
HW#2 • Write the (recursive) minimax algorithm that reports the best next move for a modified version of tic-tac-toe • When it is your move you may put an X or an O in any empty spot on the board. • First player to get three like pieces in a row wins. • It is still possible to tie.
HW#2 • How many opening moves? • What is the fewest number of moves needed for someone to win?
HW#2 - requirements • Takes in a length nine string to show the current board: “o-xxxoo--"
HW#2 - requirements • Returns the piece and the position of the best next move:
HW#2 - requirements • Returns the piece and the position of the best next move: “Put an o in cell 1”
HW#2 - requirements • The fitness function of a leaf node (an end game) is: 0=tie Otherwise : (Empty Cells +1)* [1 or -1]
HW#2 - requirements • Even numbers are negative • Odd numbers are positive
HW#2 • My suggestions: • This is a recursive algorithm. It’s easier if you recognize and embrace this. • You don’t need any “special” info about whose turn it is. You can calculate that from the board. • Check your code early with simple problems • “xx-oxooox” better take an x in cell 2 • “--xxoooxx“ better take an o in cell 0 (could also be cell 1, but I would expect 0.
Let’s Play Wumpus! • You are in Cell (1,1) facing “North” • None of the sensors register anything. • Find the gold….
Motivating KB Agents • Reflex agents keep the world clean, in large part, by dumb luck • Searching algorithm can find the shortest path from Arad to Bucharest, but can’t easily adjust when the road from Rimnicu Vilcea to Pitesti is closed for maintenance. • Logic (Knowledge-Based) agents combine general knowledge with current percepts to infer hidden aspects of current state prior to selecting actions
Knowledge Base • A knowledge base (KB) is a set of representations (sentences) of facts about the world. • TELL and ASK - two basic operations • to add new knowledge to the KB • to query what is known to the KB • Infer - what should follow after the KB has been TELLed. • A generic KB agent (Fig 7.1)
Representing Knowledge Problems: PAGE Formulation • Percepts • What can agent observe? • What can sensors tell it? • Actions • What actuators does agent have? • In what context are they applicable? • Goals • What are agents goals? Preferences (utilities)? • How does agent evaluate them (check environment, deliberate, etc.)? • Environment • What are “rules of the world”? • How can these be represented, simulated?
Tight spots (0.86 vs. 0.31)
Tight spots (0.86 vs. 0.31)
Tight spots (0.86 vs. 0.31)
Tight spots (0.86 vs. 0.31)