/
COMP SCI 5400 – Introduction to COMP SCI 5400 – Introduction to

COMP SCI 5400 – Introduction to - PowerPoint Presentation

alida-meadow
alida-meadow . @alida-meadow
Follow
378 views
Uploaded On 2017-06-05

COMP SCI 5400 – Introduction to - PPT Presentation

Artificial Intelligence Dr Daniel Tauritz Dr T Department of Computer Science tauritzdmstedu httpwebmstedutauritzd general course website httpwebmstedutauritzdcoursesintroAIhtml ID: 556100

state search node depth search state depth node move problem cost complexity time tree return path space goal frontier

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "COMP SCI 5400 – Introduction to" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

COMP SCI 5400 – Introduction toArtificial Intelligence

Dr. Daniel Tauritz (Dr. T)Department of Computer Sciencetauritzd@mst.eduhttp://web.mst.edu/~tauritzd/

general course website:

http://web.mst.edu/~tauritzd/courses/intro_AI.htmlSlide2

What is AI?

Systems that…act like humans (Turing Test)think like humansthink rationallyact rationallyPlay Ultimatum GameSlide3

Computer AgentPerceives environment

Operates autonomouslyPersists over prolonged periodsSlide4

Rational AgentsEnvironment

Sensors (percepts)Actuators (actions)Slide5
Slide6

Rational AgentsEnvironment

Sensors (percepts)Actuators (actions)Agent FunctionAgent ProgramSlide7
Slide8

Rational BehaviorDepends on:

Agent’s performance measureAgent’s prior knowledgePossible percepts and actionsAgent’s percept sequenceSlide9

Rational Agent Definition

“For each possible percept sequence, a rational agent selects an action that is expected to maximize its performance measure, given the evidence provided by the percept sequence and any prior knowledge the agent has.”Slide10

PEAS description & properties:

Fully/Partially ObservableDeterministic, Stochastic, StrategicEpisodic, SequentialStatic, Dynamic, Semi-dynamicDiscrete, ContinuousSingle agent, Multiagent

Competitive, Cooperative

Known, UnknownSlide11

Agent TypesSimple Reflex AgentsModel-Based Reflex Agents

Goal-Based AgentsUtility-Based AgentsLearning AgentsSlide12

Problem-solving agentsA definition:

Problem-solving agents are goal based agents that decide what to do based on an action sequence leading to a goal state.Slide13

Environment AssumptionsFully ObservableSingle Agent

DiscreteSequentialKnown & DeterministicSlide14

Open-loop problem-solving steps

Problem-formulation (actions & states)Goal-formulation (states)Search (action sequences)Execute solutionSlide15

Well-defined problems

Initial stateAction set: ACTIONS(s)Transition model: RESULT(s,a)Goal testStep cost: c(s,a,s’)Path cost

Solution / optimal solutionSlide16

Example problemsVacuum world

Tic-tac-toe8-puzzle8-queens problemSlide17

Search trees

Root corresponds with initial stateVacuum state space vs. search treeSearch algorithms iterate through goal testing and expanding a state until goal foundOrder of state expansion is critical!Slide18

function TREE-SEARCH(problem

) returns solution/failinitialize frontier using initial problem stateloop doif empty(frontier) then return fail

choose leaf node and remove it from frontier

if

chosen node contains goal state

then return

corresponding solution

expand chosen node and add resulting nodes to frontierSlide19

Redundant pathsLoopy paths

Repeated statesRedundant pathsSlide20

function GRAPH-SEARCH(problem)

returns solution/failinitialize frontier using initial problem stateinitialize explored set to be emptyloop do

if

empty(frontier)

then

return fail

choose leaf node and remove it from frontier

if

chosen node contains goal state

then return

corresponding solution

add chosen node to explored set

expand chosen node and add resulting nodes to frontier

only if not yet in frontier or explored setSlide21

Search node datastructuren.STATE

n.PARENT-NODEn.ACTIONn.PATH-COSTStates are NOT search nodes!Slide22

function CHILD-NODE(problem,parent,action

) returns a nodereturn a node with:STATE = problem.RESULT(parent.STATE,

action

)

PARENT =

parent

ACTION =

action

PATH-COST =

parent

.PATH

-COST +

problem

.STEP

-COST(

parent

.STATE,

action

)Slide23

FrontierFrontier = Set of leaf nodes

Implemented as a queue with ops:EMPTY?(queue)POP(queue)INSERT(element,queue)Queue types: FIFO, LIFO (stack), and priority queueSlide24

Explored SetExplored Set = Set of expanded nodesImplemented typically as a hash table for constant time insertion & lookupSlide25

Problem-solving performanceCompleteness

OptimalityTime complexitySpace complexitySlide26

Complexity in AI

b – branching factord – depth of shallowest goal nodem – max path length in state spaceTime complexity: # generated nodesSpace complexity: max # nodes storedSearch cost: time + space complexity

Total cost: search + path costSlide27

Tree Search

Breadth First Tree Search (BFTS)Uniform Cost Tree Search (UCTS)Depth-First Tree Search (DFTS)Depth-Limited Tree Search (DLTS)Iterative-Deepening Depth-First Tree Search (ID-DFTS)Slide28

Example state space #1Slide29

Breadth First Tree Search (BFTS)

Frontier: FIFO queueComplete: if b and d are finiteOptimal: if path-cost is non-decreasing function of depthTime complexity: O(b^d)Space complexity: O(

b

^

d

)Slide30

Uniform Cost Search (UCS)

g(n) = lowest path-cost from start node to node nFrontier: priority queue ordered by g(n)Slide31

Depth First Tree Search (DFTS)

Frontier: LIFO queue (a.k.a. stack)Complete: no (DGFS is complete for finite state spaces)Optimal: noTime complexity: O(bm)Space complexity: O(bm)Backtracking version of DFTS:space complexity: O(

m

)

modifies rather than copies state descriptionSlide32

Depth-Limited Tree Search (DLTS)

Frontier: LIFO queue (a.k.a. stack)Complete: not when l < dOptimal: noTime complexity: O(bl)Space complexity: O(bl)Diameter: min # steps to get from any state to any other stateSlide33

Diameter example 1Slide34

Diameter example 2Slide35

Iterative-Deepening Depth-First Tree Search (ID-DFTS)

function ID-DFS(problem) returns solution/failfor depth = 0 to ∞ do

r

esult

← DLS(

problem

,

depth

)

if

result

≠ cutoff

then return

result

Complete: Yes, if

b

is finite

Optimal: Yes, if path-cost is

nondecreasing

function of depth

Time complexity: O(

b

^

d

)

Space complexity: O(

bd

)Slide36

Bidirectional SearchBiBFTS

Complete: Yes, if b is finiteOptimal: Not “out of the box”Time & Space complexity: O(bd/2)Slide37

Example state space #2Slide38

Best First Search (BeFS)

Select node to expand based on evaluation function f(n)Node with lowest f(n) selected as f(n) correlated with path-costRepresent frontier with priority queue sorted in ascending order of f-valuesSlide39

Path-cost functionsg(n) =

lowest path-cost from start node to node nh(n) = estimated non-negative path-cost of cheapest path from node n to a goal node [with h(goal)=0]Slide40

Heuristicsh(n)

is a heuristic functionHeuristics incorporate problem-specific knowledgeHeuristics need to be relatively efficient to computeSlide41

Important BeFS algorithmsUCS:

f(n) = g(n)GBeFS: f(n) = h(n)A*S: f(n) = g(n)+h(n)Slide42

GBeFTSIncomplete (so also not optimal)

Worst-case time and space complexity: O(bm)Actual complexity depends on accuracy of h(n)Slide43

A*Sf(n) = g(n) + h(n)

f(n): estimated cost of optimal solution through node nif h(n) satisfies certain conditions, A*S is complete & optimalSlide44

Example state space # 3Slide45

Admissible heuristics

h(n) admissible if:

Example: straight line distance

A*TS optimal if

h

(

n

) admissibleSlide46

Consistent heuristics

h(n) consistent if:

Consistency implies admissibility

A*GS optimal if

h

(

n

) consistentSlide47

A* search notesOptimally efficient for consistent heuristics

Run-time is a function of the heuristic errorSuboptimal variantsNot strictly admissible heuristicsA* Graph Search not scalable due to memory requirementsSlide48

Memory-bounded heuristic search

Iterative Deepening A* (IDA*)Recursive Best-First Search (RBFS)IDA* and RBFS don’t use all avail. memoryMemory-bounded A* (MA*)Simplified MA* (SMA*)Meta-level learning aims to minimize total problem solving costSlide49

Heuristic FunctionsEffective branching factorDomination

Composite heuristicsGenerating admissible heuristics from relaxed problemsSlide50

Sample relaxed problemn-puzzle legal actions:

Move from A to B if horizontally or vertically adjacent and B is blankRelaxed problems:Move from A to B if adjacentMove from A to B if B is blankMove from A to BSlide51

Generating admissible heuristicsThe cost of an optimal solution to a relaxed problem is an admissible heuristic for the original problem.Slide52

Adversarial Search

Environments characterized by:Competitive multi-agentTurn-takingSimplest type: Discrete, deterministic, two-player, zero-sum games of perfect informationSlide53

Search problem formulation

S0: Initial state (initial board setup)Player(s): which player has the moveActions(s): set of legal movesResult(s,a): defines transitional model

Terminal test: game over!

Utility function: associates player-dependent values with terminal statesSlide54

Minimax

Time complexity: O(

b

m

)

Space complexity: O(

bm

)Slide55

Example game tree 1Slide56

Depth-Limited Minimax

State Evaluation Heuristic estimates Minimax value of a nodeNote that the Minimax value of a node is always calculated for the Max player, even when the Min player is at move in that node!Slide57

Heuristic Depth-Limited MinimaxSlide58

State Eval Heuristic QualitiesA good State Eval

Heuristic should:order the terminal states in the same way as the utility functionbe relatively quick to computestrongly correlate nonterminal states with chance of winningSlide59

Weighted Linear State Eval HeuristicSlide60

Heuristic Iterative-Deepening Minimax

IDM(s,d) calls DLM(s,1), DLM(s,2), …, DLM(s,d)Advantages:Solution availability when time is critical

Guiding information for deeper searchesSlide61

Redundant info exampleSlide62

Alpha-Beta Pruning

α: worst value that Max will accept at this point of the search treeβ: worst value that Min will accept at this point of the search treeFail-low: encountered value <= αFail-high: encountered value >= β

Prune if fail-low for Min-player

Prune if fail-high for Max-playerSlide63

DLM w/ Alpha-Beta Pruning Time Complexity

Worst-case: O(bd)Best-case: O(bd/2) [Knuth & Moore, 1975]Average-case: O(b

3d/4

)Slide64

Example game tree 2Slide65

Move Ordering Heuristics

Knowledge based (e.g., try captures first in chess)Principal Variant (PV) basedKiller Move: the last move at a given depth that caused αβ-pruning or had best minimax value

History Table:

track how often a particular move at any depth caused

αβ

-pruning or had best minimax valueSlide66

History Table (HT)Option 1: generate set of legal moves and use HT value as f-value

Option 2: keep moves with HT values in a sorted array and for a given state traverse the array to find the legal move with the highest HT valueSlide67

Example game tree 3Slide68

Search Depth Heuristics

Time based / State basedHorizon Effect: the phenomenon of deciding on a non-optimal principal variant because an ultimately unavoidable damaging move seems to be avoided by blocking it till passed the search depthSingular Extensions / Quiescence SearchSlide69

Time Per MoveConstant

Percentage of remaining timeState dependentHybridSlide70

Quiescence Search

When search depth reached, compute quiescence state evaluation heuristicIf state quiescent, then proceed as usual; otherwise increase search depth if quiescence search depth not yet reachedCall format: QSDLM(root,depth,QSdepth), QSABDLM(root,depth,QSdepth,α,β), etc.Slide71

QS game tree Ex. 1Slide72

QS game tree Ex. 2Slide73

Transposition Tables (1)Hash table of previously calculated state evaluation heuristic values

Speedup is particularly huge for iterative deepening search algorithms!Good for chess because often repeated states in same searchSlide74

Transposition Tables (2)

Datastructure: Hash table indexed by positionElement:State evaluation heuristic valueSearch depth of stored valueHash key of position (to eliminate collisions)(optional) Best move from positionSlide75

Transposition Tables (3)

Zobrist hash keyGenerate 3d-array of random 64-bit numbers (piece type, location and color)Start with a 64-bit hash key initialized to 0Loop through current position, XOR’ing hash key with Zobrist value of each piece found (note: once a key has been found, use an incremental approach that XOR’s the “from” location and the “to” location to move a piece)Slide76

Search versus lookupBalancing time versus memoryOpening table

Human expert knowledgeMonte Carlo analysisEnd game databaseSlide77

Forward pruningBeam Search (n best moves)

ProbCut (forward pruning version of alpha-beta pruning)Slide78

Null Move Forward PruningBefore regular search, perform shallower depth search (typically two ply less) with the opponent at move; if beta exceeded, then prune without performing regular search

Sacrifices optimality for great speed increaseSlide79

Futility Pruning

If the current side to move is not in check, the current move about to be searched is not a capture and not a checking move, and the current positional score plus a certain margin (generally the score of a minor piece) would not improve alpha, then the current node is poor, and the last ply of searching can be aborted.Extended Futility PruningRazoringSlide80

MTD(f)

MTDf(root,guess,depth) { lower = -∞; upper = ∞; do { beta=guess+(guess==lower);

guess = ABMaxV(root,depth,beta-1,beta);

if (guess<beta) upper=guess; else lower=guess;

} while (lower < upper);

return guess; } // also needs to return best moveSlide81

IDMTD(f)

IDMTDf(root,first_guess,depth_limit) { guess = first_guess; for (depth=1; depth ≤ depth_limit; depth++) guess = MTDf(root,guess,depth);return guess; } // actually needs to return best moveSlide82
Slide83

Adversarial Search in Stochastic Environments

Worst Case Time Complexity: O(b

m

n

m

) with

b

the average branching factor,

m

the deepest search depth, and

n

the average chance branching factorSlide84

Example “chance” game treeSlide85

Expectiminimax & PruningInterval arithmetic

Monte Carlo simulations (for dice called a rollout)Slide86

State-Space SearchComplete-state formulationObjective function

Global optimaLocal optima (don’t use textbook’s definition!)Ridges, plateaus, and shouldersRandom search and local searchSlide87

Steepest-Ascent Hill-ClimbingGreedy Algorithm - makes locally optimal choices

Example8 queens problem has 88≈17M statesSAHC finds global optimum for 14% of instances in on average 4 steps (3 steps when stuck)SAHC w/ up to 100 consecutive sideways moves, finds global optimum for 94% of instances in on average 21 steps (64 steps when stuck)Slide88

Stochastic Hill-ClimbingChooses at random from among uphill movesProbability of selection can vary with the steepness of the uphill move

On average slower convergence, but also less chance of premature convergenceSlide89

First-choice Hill-ClimbingChoose the first randomly generated uphill moveGreedy, incomplete, and suboptimal

Practical when the number of successors is largeLow chance of premature convergence as long as the move generation order is randomizedSlide90

Random-restart Hill-ClimbingSeries of HC searches from randomly generated initial states until goal is found

Trivially completeE[# restarts]=1/p where p is probability of a successful HC given a random initial stateFor 8-queens instances with no sideways moves, p≈0.14, so it takes ≈7 iterations to find a goal for a total of ≈22 stepsSlide91

Simulated Annealing

function SA(problem,schedule) returns solution state current

←MAKE-NODE

(

problem

.INITIAL

-STATE)

for

t

=1

to

do

T

schedule

(t)

if

T

=0

then return

current

next←RANDOM-SUCCESOR

(current)

E←next

.VALUE

current

.VALUE

if

E

> 0

then

current←next

else

current←next

with probability of

e

E

/TSlide92

Population Based Local Search

Deterministic local beam searchStochastic local beam searchEvolutionary AlgorithmsParticle Swarm OptimizationAnt Colony OptimizationSlide93

Particle Swarm Optimization

PSO is a stochastic population-based optimization technique which assigns velocities to population members encoding trial solutionsPSO update rules:

PSO demo:

http://

www.borgelt.net/psopt.htmlSlide94

Ant Colony OptimizationPopulation based

Pheromone trail and stigmergetic communicationShortest path searchingStochastic moves

ACO demo

:

http://

www.borgelt.net/acopt.htmlSlide95

Online SearchOffline search vs. online search

Interleaving computation & actionDynamic, nondeterministic, unknown domainsExploration problems, safely explorableAgents have access to:ACTIONS(s)c(s,a,s’)

 cannot be used until RESULT(

s

,

a

)

GOAL-TEST(

s

)Slide96

Online Search OptimalityCR – Competitive RatioTAPC – Total Actual Path Cost

C* - Optimal Path CostBest case: CR = 1Worst case: CR = ∞Slide97

Online Search AlgorithmsOnline-DFS-AgentOnline Local Search

Learning Real-Time A* (LRTA*)Slide98

function ONLINE-DFS-AGENT(s’

) returns action persistent: result, untried, unbacktracked, s, a if GOAL-TEST(

s

)

then return

stop

if

s

is a new state

then

untried

[

s

]←ACTIONS(

s

)

if

s

is not null

then

result

[

s

,

a

]←

s

add

s

to front of

unbacktracked

[

s

]

if

untried

[

s

] is empty

then

if

unbacktracked

[

s

] is empty

then return

stop

else

a

←action

b

so

result

[

s

’,

b

]=POP(

unbacktracked

[

s

])

else

a

←POP

(

untried

[

s

])

s

s

return

aSlide99

Online Local Search

Locality in node expansionsInherently onlineNot useful in base formRandom WalkSlide100

function LRTA*-AGENT(s’

) returns action persistent: result, H, s, a if GOAL-TEST(

s

)

then return

stop

if

s

is a new state

then

H

[

s

]←

h

(

s

)

if

s

is not null

then

result

[

s

,

a

]←

s

H[s]←

min

b

ϵ

ACTIONS(s)

LRTA*-COST(

s

,

b

,

result

[

s

,

b

],

H

)

a

b

ϵ

ACTIONS

to minimize LRTA*-COST(

s

’,

b

,

result

[

s

’,

b

],

H

)

s

s

return

a

f

unction

LRTA*-COST(

s

,

a

,

s

’,

H

)

returns

a cost estimate

if

s

is undefined

then return

h

(

s

)

else return

c

(

s

,

a,s

’)+H[

s’

]Slide101

Online Search Maze Problem (Fig. 4.19)Slide102

Online Search Example Graph 1aSlide103

Online Search Example Graph 1bSlide104

Online Search Example Graph 2Slide105

Online Search Example Graph 3Slide106

Key historical events for AI

4th century BC Aristotle propositional logic1600’s Descartes mind-body connection1805 First programmable machineMid 1800’s Charles Babbage’s “difference engine” & “analytical engine”Lady Lovelace’s Objection1847 George Boole propositional logic

1879 Gottlob Frege predicate logicSlide107

Key historical events for AI

1931 Kurt Godel: Incompleteness TheoremIn any language expressive enough to describe natural number properties, there are undecidable (incomputable) true statements1943 McCulloch & Pitts: Neural Computation1956 Term “AI” coined1976 Newell & Simon’s “Physical Symbol System Hypothesis” A physical symbol system has the necessary and sufficient means for general intelligent action.Slide108

Key historical events for AIAI Winters (1974-80, 1987-93)

Commercialization of AI (1980-)Rebirth of Artificial Neural Networks (1986-)Unification of Evolutionary Computation (1990s)Rise of Deep Learning (2000s)Slide109

Weak AI vs. Strong AI

Mind-Body ConnectionRené Descartes (1596-1650)RationalismDualismMaterialismStar Trek & Souls

Chinese Room

EthicsSlide110

How difficult is it to achieve AI?

Three Sisters PuzzleSlide111

AI courses at S&T

CS5400 Introduction to Artificial Intelligence (FS2016,SP2017)CS5401 Evolutionary Computing (FS2016,FS2017)CS5402 Data Mining & Machine Learning (FS2016,SS2017)CS5403 Intro to Robotics (FS2015)CS5404 Intro to Computer Vision (FS2016)CS6001 Machine Learning in Computer Vision (SP2016,SP2017)

CS6400

Advanced Topics in AI (SP2013)

CS6401 Advanced Evolutionary Computing (SP2016)

CS6402 Advanced Topics in Data

Mining (SP2017)

CS6403 Advanced Topics in Robotics

CS6405 Clustering Algorithms

CpE

5310 Computational Intelligence

CpE

5460 Machine Vision

EngMgt

5413 Introduction to Intelligent Systems

SysEng

5212 Introduction to Neural Networks and Applications

SysEng

6213 Advanced Neural Networks