Title: Intelligent Systems 2II40 C4
1Intelligent Systems (2II40)C4
October 2005
2Outline
- Search
- Uninformed
- Informed
- Heuristic
- Local
- Online
- Knowledge and Reasoning
3II.2.B. Local Search
- Greedy local search (hill-climbing)
- Simulated annealing
- Genetic algorithms
4Why local search?
- path not part of solution
- optimization problem
- max(objective function)
- no goal
Objective function
State space
5Hill-climbing (gradient ascent/descent)
- Like climbing Everest in thick fog with amnesia
6Gradient descent/ ascent
- Why is it an informed algorithm?
7Visualizing hill-climbing
- Problem alg. can get stuck in local minima
8Simulated annealing
9Properties of simulated annealing
- created 53 by Metropolis et al., for physical
process modeling - Metallurgy annealing heating metals/ glass to
high temperature, then cooling gradually (to
harden them) - used in airline scheduling, VLSI layout, etc.
- allowing moves up-hill
- why?
10Simulated annealing probability
- Probability of state occupation
- At fixed temperature T, probability
Boltzman distribution - If T decreases slowly enough, the best state
is always reached
11Simulated Annealing Algorithm
- function S_A(problem, schedule) returns a
solution state - inputs problem, a problem
- schedule, a mapping from time to temperature
- local variables current, a node
- next, a node
- T, a temperature controlling the
probability of downwards steps - current?MAKE-NODE(INITIAL-STATEproblem)
- for t ?1 to ? do
- T ? schedulet
- if T0 then return current
- next ? a randomly selected successor of
current - ?E ? VALUEnext VALUEcurrent
- if ?E gt 0 then current ?next
- else current ?next with probability e?E/T
12Simulated annealing
- Why is it an informed algorithm?
13Genetic Algorithms(stochastic hill-climbing)
14GA terminology
- Chromosome
- Genes
- Alleles
- Locus
- Crossover
- Mutation
state, made of genes state
variables possible values for genes position
along the chromosome new child
chromosome generation by aligning two
parents new chromosome generation from
one individual (altering val. of loci)
15Crossover
Single point cross-over
Multiple point cross-over
16Mutation
Problems validity check!!
17Genetic Algorithm
- function G_A(population, FITNES-FN) returns an
individual - inputs population, a set of individuals
- FITNESS-FN, a fct. measuring fitness of an
individual - repeat
- new_population ? empty set
- loop for i from 1 to SIZE(population) do
- x ? RANDOM_SELECTION(population,
FITNESS-FN) - y ? RANDOM_SELECTION(population,
FITNESS-FN) - child ? REPRODUCE(x,y)
- if (small random probability) then child ?
MUTATE(child) - add child to new_population
- population ? new_population
- until some individual is fit enough, or enough
time has elapsed - return the best individual in the population,
according to the FITNESS-FN
18Selection some examples
- Fitness-proportionate no. offspring proportional
w. fitness (roulette wheel) - Linear fitness scaling (simfic)
- Boltzmann fitness sc. (siexp(fi/T))
- Tournament selection (binary 2 by 2)
- Elitism (a group of individuals pass unchanged)
19Genetic algorithm
- Why is it an informed algorithm?
20Homework 4 part 1
- Find the memory requirements (propertiesspace)
of the simulated annealing algorithm (Hint
express space in states kept in memory). - How many alleles are there for a binary-encoded
gene that is N bits wide? - Find out where the name LTRA comes from? What
does the L stand for, and how do you explain it?
21GA Family Evolutionary computing
- Evolutionary strategies (ES- Rechenberg, 73)
- Genetic programming (GP - Langdon, 94)
- Evolutionary programming (EP - Fogel, late 80s)
22Homework 4 part 2
- What are schema, schema order, defining length in
GA? - find definitions ES, GP, EP! What are the
differences to GA? - Check out the No Free Lunch Theorem!
- Perform step FAQ 7 of the project.
23III.2.c. Online search agents and unknown
environments
24Online search
- Exploration
- unknown environment
- local algorithms
- knowledge of limited vicinity of current state
- outperform random walk !!
25LRTA steps (in 1-dimensional space)
Initial state
8
9
2
2
4
3
(1)
26- function LRTA(s) returns an action
- inputs s, a percept that identifies the current
state - static result, a table, indexed by action and
state, empty - H, a table of cost estimates indexed by
state, empty - s,a, the previous state and action,
initially null - if GOAL-TEST(s) then return stop
- if s is a new state (not in H) then Hs ?h(s)
- unless s is null
- resulta,s ?s
- Hs ? min (b?ACTIONS(s)) LRTA-COST(s,b,resul
tb,s,H) - a ? action b?ACTIONS(s) w. min
LRTA- COST(s,b,resultb,s,H) - s ?s
- return a
- function LRTA-COST(s,a,s,H) returns a cost
estimate - if s undefined then return h(s)
- else return c(s,a,s) Hs
27Homework 4 part 3
- Perform as many LTRA steps till the current
state leaves this surface.
10
9
5
4
4
3
8
9
2
2
4
3
8
9
2
2
4
3
8
9
4
3
2
1
8
9
2
2
1
1
28IV. Knowledge and reasoning
29IV. Knowledge and reasoning
- IV.1. Generalities on logics
- IV.2. Propositional logic short visit
- IV.3. First-order logic (FOL) short visit
- IV.4. Knowledge-based agents
- IV.5. Knowledge representation
30IV.1. Generalities on logics
31Types of logic
- Logics are characterized by what they commit to
as primitives - Ontological commitment
- what exists facts? Objects? Time? Beliefs?
- Epistemological commitment
- what states of knowledge?
32Basic concepts of logic (PL)
- Syntax formal structure of sentences
- Semantics truth of sentences w.r.t. models
- Entailment necessary truth of sentence given
another - Inference deriving sentences from other
sentences - Soundness deriving only entailed sentences
- Completeness can produce all entailed sentences
- Syntax
- Semantics
- Entailment
- Inference
- Soundness
- Completeness
33IV.2. Propositional logic (PL)
34Models
- What is a model?
- What is a model in propositional logics?
- We say m is a model of a sentence a
If a is true in m. - M(a) is defined as the set of all models of a
- KB entails a if and only if M(KB) ? M(a)
35KB entails a
M(a)
M(KB)
Example KB x is a technical university and
x is a Dutch university
a x is a Dutch
university Model xTU/e
36Proof methods
- Inference rules
- Model checking
37Pros cons of PL
- Declarative
- syntax pieces correspond to facts
- Partial/ disjunctive/ negated info
- allowed
- Compositional
- meaning from components
- Context-independent
- unlike nat. lang.
- Limited expressive power
- rel. cannot be expressed
38Extra Hw Revisit read
- Inferences, de Morgan, model checking, Horn
clauses, modus Ponens, forward backward
chaining, conjunctive/ disjunctive normal form - Propositional logic (PL)
39IV.3. First order logic (FOL)
40Logic programming
41Extra Hw Revisit read
- Reducing FOL inference to PL inference,
unification, generalized modus Ponens, forward
backward chaining, resolution - First order logic (FOL)
42IV.4. Knowledge-based agents
43Knowledge bases
- Set of sentences in a formal language
Domain independent algorithms
Inference engine
Knowledge base
Domain specific content
44Knowledge based agents
- Agents that make inferences on KB
- TELL system what it needs to know
- ASK system what to do
- Agent description
- Knowledge level what agent knows, regardless
of implementation - Implementation level data structures, algorithms
45Simple knowledge-based agent
46Rule-based system
- Oldest and simplest knowledge-based system
- Contains a set of rules of the form
- IF ltconditiongt THEN ltconclusiongt
- e.g.,
- IF the tap is open THEN water flows
- Expert systems should respond to
- Why? (during resolution)
- How? (after conclusion)
47Forward chaining simple view
Start
Empty the conflict set
Select rules to examine (often all rules are
selected)
Evaluate condition part of first rule
Evaluate condition part of next rule
no
Condition met?
yes
Add rule to conflict set
yes
no
More rules?
Conflict set empty?
Select a rule from the conflict set and fire it
no
yes
Stop
48Backward chaining
Start
no
Goal satisfied?
yes
no
yes
More solutions?
success
Rule exists To satisfy goal?
Stop
no
failure
yes
condition part of rule is next goal
49IV.4. Knowledge representation
50Why knowledge representation?
- content?
- trivial?
- buzzwords
- ontology,
- taxonomy,
- event calculus (ECA),
- belief theory,
- semantic networks
51IV.4. Knowledge representation
- Ontological engineering
- Categories, objects, hierarchies, axioms
- Actions, situations and events
- Mental events and mental objects
- Internet shopping world
- Reasoning systems for categories
- Semantic networks
- Description logic
52IV.4.A. Ontological engineering
53Ontology
- Aristoteles The metaphysical study of the
nature of being and existence - AI (Gruber) A shared and common understanding
of some domain that can be communicated between
people and application systems
54Ontological Engineering
- in toy domains (vacuum cleaner, minesweeper)
representation is often not that important - in real world applications, you need common
consensual representations to understand each
other - Ontological engineering knowledge engineering
on a larger scale
55Ontology definition
- Ontology common (consistent)vocabulary for
a specific domain - hierarchy of vocabulary
- general relations
- an interpretation of the relations
- E.g., here, representing
- physical objects, actions, time, beliefs
56Upper ontology of the world
Anything
AbstractObjects
GeneralizedEvents
Sets
Numbers
Interval
Places
PhysicalObjects
Representational Objects
Processes
Categories
Sentences
Measurements
Moments
Things
Stuff
Times
Agents
Solid
Liquid
Gas
Weights
Animals
Questions Does a general purpose ontology make
sense? Do all special purpose ontologies fit
in? Is FOL to capture knowledge?
Humans
57General purpose ontology
- Should be applicable in any domain
- Some specific domains/ applications require
unification (merging) of ontologies
58Categories objects