SlideShare a Scribd company logo
1 of 75
Artificial Intelligence
Genetic Algorithms
Learning
Study of processes that lead to self-
improvement of machine performance.
It implies the ability to use knowledge to
create new knowledge or integrating new
facts into an existing knowledge structure
Learning typically requires repetition and
practice to reduce differences between
observed and actual performance
2
Learning
Definition:
A computer program is said to learn from
experience E with respect to some class
of tasks T and performance measure P, if
its performance at tasks in T, as
measured by P, improves with
experience.
3
Learning & Adaptation
4
• ”Modification of a behavioral tendency by
expertise.” (Webster 1984)
• ”A learning machine, broadly defined as any
device whose actions are influenced by past
experiences.” (Nilsson 1965)
• ”Any change in a system that allows it to
perform better the second time on repetition of
the same task or on another task drawn from
the same population.” (Simon 1983)
Negative Features of Human
Learning
Its slow (5-6 years for motor skills 12-20
years for abstract reasoning)
Inefficient
Expensive
There is no copy process
Learning strategy is often a function of
knowledge available to learner
5
Applications of ML
Learning to recognize spoken words
Learning to drive an autonomous
vehicle
Learning to classify objects
Learning to play world-class
backgammon
Designing the morphology and
control structure of electro-
mechanical artefacts 6
Different kinds of learning…
Supervised learning:
Someone gives us examples and the right answer for
those examples
We have to predict the right answer for unseen
examples
Unsupervised learning:
We see examples but get no feedback
We need to find patterns in the data
Reinforcement learning:
We take actions and get rewards
Have to learn how to get high rewards
Learning with a Teacher
 supervised learning
 knowledge represented by a set of input-output
examples (xi,yi)
 minimize the error between the actual response of
the learner and the desired response
8
Environment Teacher
Learning
system
state x
S
desired
response
actual
response
error signal
+
-
Unsupervised Learning
 self-organized learning
 no teacher
 task independent quality measure
 identify regularities in the data and discover classes
automatically
9
Environment
Learning
system
state
Learning by Examples
10
Sky Temp Humi
d
Wind Water Fore-
cast
Enjoy
Sport
Sunny
Sunny
Rainy
Sunny
Warm
Warm
Cold
Warm
Norma
l
High
High
High
Strong
Strong
Strong
Strong
Warm
Warm
Warm
Cool
Same
Same
Chane
Chane
Yes
Yes
No
Yes
Concept: ”days on which my friend Aldo enjoys his
favourite water sports”
Task: predict the value of ”Enjoy Sport” for an
arbitrary day based on the values of the other
attributes
Decision trees
high Income?
yes no
NO
yes no
NO
Criminal record?
YES
Constructing a
decision tree, one
step at a time
address?
yes no
+a, -c, +i, +e, +o, +u: Y
-a, +c, -i, +e, -o, -u: N
+a, -c, +i, -e, -o, -u: Y
-a, -c, +i, +e, -o, -u: Y
-a, +c, +i, -e, -o, -u: N
-a, -c, +i, -e, -o, +u: Y
+a, -c, -i, -e, +o, -u: N
+a, +c, +i, -e, +o, -u: N
-a, +c, -i, +e, -o, -u: N
-a, -c, +i, +e, -o, -u: Y
-a, +c, +i, -e, -o, -u: N
-a, -c, +i, -e, -o, +u: Y
+a, -c, +i, +e, +o, +u: Y
+a, -c, +i, -e, -o, -u: Y
+a, -c, -i, -e, +o, -u: N
+a, +c, +i, -e, +o, -u: N criminal? criminal?
-a, +c, -i, +e, -o, -u: N
-a, +c, +i, -e, -o, -u: N
-a, -c, +i, +e, -o, -u: Y
-a, -c, +i, -e, -o, +u: Y
+a, -c, +i, +e, +o, +u: Y
+a, -c, +i, -e, -o, -u: Y
+a, -c, -i, -e, +o, -u: N
+a, +c, +i, -e, +o, -u: N
income?
+a, -c, +i, +e, +o, +u: Y
+a, -c, +i, -e, -o, -u: Y
+a, -c, -i, -e, +o, -u: N
yes no
yes no
yes no Address was
maybe not the
best attribute
to start with…
Different approach: nearest neighbor(s)
Next person is -a, +c, -i, +e, -o, +u. Will we get paid back?
Nearest neighbor: simply look at most similar example in
the training data, see what happened there
+a, -c, +i, +e, +o, +u: Y (distance 4)
-a, +c, -i, +e, -o, -u: N (distance 1)
+a, -c, +i, -e, -o, -u: Y (distance 5)
-a, -c, +i, +e, -o, -u: Y (distance 3)
-a, +c, +i, -e, -o, -u: N (distance 3)
-a, -c, +i, -e, -o, +u: Y (distance 3)
+a, -c, -i, -e, +o, -u: N (distance 5)
+a, +c, +i, -e, +o, -u: N (distance 5)
Nearest neighbor is second, so predict N
k nearest neighbors: look at k nearest neighbors, take a vote
E.g., 5 nearest neighbors have 3 Ys, 2Ns, so predict Y
Approaches to Machine Learning
Numerical approaches
Build numeric model with parameters based on
successes
Structural approaches
Concerned with the process of defining
relationships by creating links between
concepts
14
Learning methods
Decision rules:
If income < $30.000 then reject
Bayesian network:
P(good | income, credit history,….)
Neural Network:
Nearest Neighbor:
Take the same decision as for the customer in
the data base that is most similar to the
applicant
15
16
Classification
 Assign object/event to one of a given finite set of
categories.
 Medical diagnosis
 Credit card applications or transactions
 Fraud detection in e-commerce
 Worm detection in network packets
 Spam filtering in email
 Recommended articles in a newspaper
 Recommended books, movies, music, or jokes
 Financial investments
 DNA sequences
 Spoken words
 Handwritten letters
 Astronomical images
17
Problem Solving / Planning /
Control
Performing actions in an environment in order
to achieve a goal.
Solving calculus problems
Playing checkers, chess, or backgammon
Balancing a pole
Driving a car or a jeep
Flying a plane, helicopter, or rocket
Controlling an elevator
Controlling a character in a video game
Controlling a mobile robot
Another Example:
Handwriting Recognition
Background concepts:
Pixel information
Categorisations:
(Matrix, Letter) pairs
Both positive &
negative
Task
Correctly categorise
An unseen example
Into 1 of 26 categories
 Positive:
– This is a letter S:
 Negative:
– This is a letter Z:
Genetic Algorithm
Genetic Algorithms have been applied
successfully to a variety of AI
applications
For example, they have been used to
learn collections of rules for robot
control.
Genetic Algorithms and genetic
programming are called Evolutionary
Computation
Theory of Evolution
Every organism has unique attributes
that can be transmitted to its offspring
Selective breeding can be used to manage
changes from one generation to the next
Nature applies certain pressures that
cause individuals to evolve over time
Genetic Algorithms (GAs) and
Genetic Programming (GP)
Genetic Algorithms
Optimising parameters for problem solving
Represent the parameters in the solution(s)
As a “bit” string normally, but often something else
Evolve answers in this representation
Genetic Programming
Representation of solutions is richer in general
Solutions can be interpreted as programs
Evolutionary process is very similar
GA
Genetic algorithms provide an AI method
by an analogy of biological evolution
It constructs a population of evolving
solutions to solve the problem
Genetic Algorithms
What are they?
Evolutionary algorithms that make use of operations
like mutation, recombination, and selection
Uses?
Difficult search problems
Optimization problems
Machine learning
Adaptive rule-bases
Classical GAs
 Representation of parameters is a bit string
Solutions to a problem represented in binary
101010010011101010101
 Start with a population (fairly large set)
Of possible solutions known as individuals
 Combine possible solutions by swapping material
Choose the “best” solutions to swap material between
and kill off the worse solutions
This generates a new set of possible solutions
 Requires a notion of “fitness” of the individual
Base on an evaluation function with respect to the
problem
Genetic Algorithm
Genotype space =
{0,1}L
Phenotype space
Encoding
(representation)
Decoding
(inverse representation)
011101001
010001001
10010010
10010001
Representation
GA Representation
Genetic algorithms are represented as
gene
Each population consists of a whole set
of genes
Using biological reproduction, new
population is created from old one.
The Initial Population
Represent solutions to problems
As a bit string of length L
Choose an initial population size
Generate length L strings of 1s & 0s
randomly
Strings are sometimes called
chromosomes
Letters in the string are called “genes”
We call the bit-string “individuals”
Initialization
Initial population must be a
representative sample of the search space
Random initialization can be a good idea
(if the sample is large enough)
The gene
Each gene in the population is
represented by bit strings.
001 10 10
Outlook Wind play tennis
0011010
Gene Example
The idea is to use a bit string to describe
the value of attribute
The attribute Outlook has 3 values
(sunny, overcast, raining)
So we use 3 bit length to represent
attribute outlook
010 represent the outlook = overcast
GA
The fitness function evaluates each
solution and decide it will be in next
generation of solutions
Selection
Want to to give preference to “better”
individuals to add to mating pool
If entire population ends up being selected
it may be desirable to conduct a tournament
to order individuals in population
Would like to keep the best in the mating
pool and drop the worst
Selection methods
Common selection methods used in GAs are
Fitness Proportionate Selection
Rank Selection
Tournament Selection
Rank Selection
All individuals are sorted according to
their fitness.
Each individual is then assigned a
probability of being selected from some
prior probability density.
 Main idea: better individuals get higher chance
Chances proportional to fitness
Implementation: roulette wheel technique
Assign to each individual a part of the
roulette wheel
 Spin the wheel n times to select n
individuals
Selection
fitness(A) = 3
fitness(B) = 1
fitness(C) = 2
A C
1/6 = 17%
3/6 = 50%
B
2/6 = 33%
Roulette Wheel Selection
1 2 3 1 3 5 1 2
0 18
2
1 3 4 5 6 7 8
Rnd[0..18] = 7
Chromosome4
Parent1
Rnd[0..18] = 12
Chromosome6
Parent2
Tournament
Selection
Select a group of N
(N>1) members.
Select the fittest member of this group and
discard the rest.
New Population
To build new population from old one we
use genetic operators to evolve the
population of solutions
Genetic operators are
Crossover operator
Mutation operator
Production operator
Crossover operator
It produces two new offspring from two
parent strings by copying selected bits
from each parent.
11101001000
00001010101
00001001000
11101010101
Crossover
In sexual reproduction the genetic codes
of both parents are combined to create
offspring
Would like to keep 60/40 split between
parent contributions
95/5 splits negate the benefits of
crossover (too much like asexual
reproduction)
Mutation operator
It produces offspring from single parent
by small random change in bit string.
11101001000
11100001000
Mutation
Mutation is important for maintaining diversity in
the genetic code
In humans, mutation was responsible for the
evolution of intelleigence
Example: The occasional (low probably)
alteration of a bit position in a string
Replacement
Determine when to insert new offspring
into the population and which individuals
to drop out based on fitness
Steady state evolution calls for the same
number of individuals in the population,
so each new offspring processed one at a
time so fit individuals can remain a long
time
The Termination Check
 Termination may involve testing whether an individual
solves the problem to a good enough standard
 Not necessarily having found a definitive answer
 Alternatively, termination may occur after a fixed time
 Or after a fixed number of generations
 Note that the best individual in a population
 So, your GA should:
 Record the best from each generation
 Output the best from all populations as the answer
Why use genetic algorithms?
They can solve hard problems
Easy to interface genetic algorithms to existing
simulations and models
GA’s are extensible
GA’s are easy to hybridize
GA’s work by sampling, so populations can be
sized to detect differences with specified error
rates
Use little problem specific code
Example
No. A1 A2 Classification
1 T T +
2 T T +
3 T F -
4 F F +
5 F T -
6 F T -
Representation
A1 ={T, F}  10 = T && 01 = F
A2={T, F}  10 = T && 01 = F
Classification = {+, -}  1 = + && 0 =
-
The gene is A1 (2) + A2 (2)
+Classification (1) = 5 bits
[1 0 1 0 1]
A1= T & A2=T & Classification = +
Initial Population
Let we construct 10 genes randomly as
[11101] fitness = 4 cases { 2 true and 2
false}=0.5
[10001] fitness = 0.66
[01011] fitness = 0.0
[01011]
[01111]
[11111]
[01000]
[00001]
[11110]
[01100]
Crossover operation
[11101] X [01100][11100] + [01101]
[01011] X [10001]  [11001] +
[01010]
Mutation Operation
[01011]  [01010]
[11111]  [11011]
New Population
[11100]
[01010]
[11001]
[01111]
[11011]
[01000]
[00001]
[11110]
[01101]
GA Application
Searching maximum of function
Search for value of x to y=f(x) be
maximum.
X play the role of genes, binary code of x
value in 8 bits gene (chromosome)
Y the role of fitness
GA Application
Given the digits 0 through 9 and
operators +, -, *, and /.
Find sequence that represent given target
number.
E.g. Given number 23, the sequence
+6+5*4/2+1
If number is 75.5, then 5/2+9*7-5
GA Application
Four bits are required to represent char
0:0000, …….9:1001, +:1010, -:1011,
*:1100, /:1101
Gene:0110101001011100010011010010
10100001 is 6+5*4/2+1 = 23
TSP Application
Use a genetic algorithm to solve the traveling
salesman problem we could begin by creating a
population of candidate solutions
We need to define mutation, crossover, and
selection methods to aid in evolving a solution
from this population
Related Technologies
Genetic Programming
Existing programs are combined to breed
new programs
Artificial Life
Using cellular automata to simulate
population growth
Automatic Programming
Getting software to write software
Brilliant idea, but turned out to be very difficult
Intuitively, should be easier than other tasks
The automatic programming community
Didn’t deliver on early promises
So people began to avoid this area
And “Automated Programming” became words of
warning
Questions to be Answered
 How is the programming task specified?
 How are the ingredients chosen/specified/
 How do we represent programs?
 Which enables reproduction, evaluation, etc.
 How are individuals chosen for reproduction?
 How are offspring produced?
 How are termination conditions specified?
 We will start by looking at the representation of programs,
as this is required to answer many questions
Genetic Programming
It same as GA but the gene is tree
Each tree = computer program
It contain a population of computer
programs to solve the problem
specifically
A Tree Representation
 Idea: represent programs as trees
 Each node is either a function or a terminal
 Functions
 Examples: add, multiply, square root, sine, cosine
 Problem specific ones: getPixel(), goLeft()
 Terminals
 Constants and variables, e.g., 10, 17, X, Y
 The nodes below a function node
 Are the inputs to that function
 The node itself represents the output from the function
 As input to the parent node
 The nodes at the ends of branches are terminals only
Computer Programs as Trees
Infix/Postfix
(2 + a)*(4 - num)
*
+ -
2 a 4 num
“Breeding” Computer Programs
Start off with a large “pool” of random
computer programs.
Need a way of coming up with the best solution
to the problem using the programs in the “pool”
Based on the definition of the problem and
criteria specified in the fitness test, mutations
and crossovers are used to come up with new
programs which will solve the problem.
Tree based representation
Trees are a universal form, e.g. consider
Arithmetic formula
Logical formula
Program











1
5
)
3
(
2
y
x

(x  true)  (( x  y )  (z  (x  y)))
i =1;
while (i < 20)
{
i = i +1
}
Tree based representation











1
5
)
3
(
2
y
x

Tree based representation
(x  true)  (( x  y )  (z  (x  y)))
Tree based representation
i =1;
while (i < 20)
{
i = i +1
}
Mutation
Most common mutation: replace
randomly chosen subtree by randomly
generated tree
Example of Mutation
Child 2
Parent 1 Parent 2
Child 1
Crossover operation
Application Domain #1
Evolving Electronic Circuits
 John Koza
Stanford Professor and CEO of “Genetic
Programming Inc.”
Guru of Genetic Programming, very successful
Made GP more mainstream by his success
 Particularly fruitful area:
Producing designs for circuit diagrams
E.g., antennas, amplifiers, etc.
Functions mimic how transistors, resistors, etc. work
GP Application 1
Given the digits 0 through 9 and
operators +, -, *, and /. Find sequence
that represent given target number.
Given number 23, the sequence
+6+5*4/2+1
If number is 75.5, then 5/2+9*7-5
Generate Random Programs
Generate well-formed formulas using
prefix notation from variable A and a set
of function symbols, for example { +,
-, *, %, sqrt }
Examples:
( + A ( * ( sqrt A ) A ) )
(* A (- (* A A) (sqrt A) ) )
Examples of Genetic Programs
Symbolic Regression - the process of
discovering both the functional form of a
target function and all of its necessary
coefficients, or at least an approximation to
these.
Analog circuit design - Embryo circuit -
Initial circuit which is modified to create a
new circuit according to functionality
criteria.

More Related Content

Similar to Genetic Algorithms.ppt

Machine learning presentation (razi)
Machine learning presentation (razi)Machine learning presentation (razi)
Machine learning presentation (razi)Rizwan Shaukat
 
Lecture 7
Lecture 7Lecture 7
Lecture 7butest
 
Lecture 7
Lecture 7Lecture 7
Lecture 7butest
 
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAI
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAIDeep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAI
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAIJack Clark
 
week9_Machine_Learning.ppt
week9_Machine_Learning.pptweek9_Machine_Learning.ppt
week9_Machine_Learning.pptbutest
 
Statistical foundations of ml
Statistical foundations of mlStatistical foundations of ml
Statistical foundations of mlVipul Kalamkar
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithmsArunangsu Sahu
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018Nancy Garmer
 
Machine Learning
Machine LearningMachine Learning
Machine Learningbutest
 
SPSS statistics - get help using SPSS
SPSS statistics - get help using SPSSSPSS statistics - get help using SPSS
SPSS statistics - get help using SPSScsula its training
 
Machine Learning presentation.
Machine Learning presentation.Machine Learning presentation.
Machine Learning presentation.butest
 
Machine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxMachine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxVenkateswaraBabuRavi
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Codiax
 
Machine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptMachine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptbutest
 

Similar to Genetic Algorithms.ppt (20)

S10
S10S10
S10
 
S10
S10S10
S10
 
Machine learning presentation (razi)
Machine learning presentation (razi)Machine learning presentation (razi)
Machine learning presentation (razi)
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAI
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAIDeep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAI
Deep Reinforcement Learning Through Policy Optimization, John Schulman, OpenAI
 
week9_Machine_Learning.ppt
week9_Machine_Learning.pptweek9_Machine_Learning.ppt
week9_Machine_Learning.ppt
 
Statistical foundations of ml
Statistical foundations of mlStatistical foundations of ml
Statistical foundations of ml
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
2019 Fall Series: Postdoc Seminars - Special Guest Lecture, There is a Kernel...
2019 Fall Series: Postdoc Seminars - Special Guest Lecture, There is a Kernel...2019 Fall Series: Postdoc Seminars - Special Guest Lecture, There is a Kernel...
2019 Fall Series: Postdoc Seminars - Special Guest Lecture, There is a Kernel...
 
Ml ppt at
Ml ppt atMl ppt at
Ml ppt at
 
SPSS statistics - get help using SPSS
SPSS statistics - get help using SPSSSPSS statistics - get help using SPSS
SPSS statistics - get help using SPSS
 
Machine Learning presentation.
Machine Learning presentation.Machine Learning presentation.
Machine Learning presentation.
 
Machine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxMachine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptx
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
 
ML_lec1.pdf
ML_lec1.pdfML_lec1.pdf
ML_lec1.pdf
 
Machine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.pptMachine Learning Applications in NLP.ppt
Machine Learning Applications in NLP.ppt
 

More from RohanBorgalli

SHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptSHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptRohanBorgalli
 
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptUsing Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptRohanBorgalli
 
02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt02_Architectures_In_Context.ppt
02_Architectures_In_Context.pptRohanBorgalli
 
Automobile-pathway.pptx
Automobile-pathway.pptxAutomobile-pathway.pptx
Automobile-pathway.pptxRohanBorgalli
 
Autoregressive Model.pptx
Autoregressive Model.pptxAutoregressive Model.pptx
Autoregressive Model.pptxRohanBorgalli
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxRohanBorgalli
 
Time Series Analysis_slides.pdf
Time Series Analysis_slides.pdfTime Series Analysis_slides.pdf
Time Series Analysis_slides.pdfRohanBorgalli
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdfRohanBorgalli
 
prace_days_ml_2019.pptx
prace_days_ml_2019.pptxprace_days_ml_2019.pptx
prace_days_ml_2019.pptxRohanBorgalli
 

More from RohanBorgalli (14)

SHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptSHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.ppt
 
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptUsing Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
 
02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt
 
Automobile-pathway.pptx
Automobile-pathway.pptxAutomobile-pathway.pptx
Automobile-pathway.pptx
 
Autoregressive Model.pptx
Autoregressive Model.pptxAutoregressive Model.pptx
Autoregressive Model.pptx
 
IntrotoArduino.ppt
IntrotoArduino.pptIntrotoArduino.ppt
IntrotoArduino.ppt
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptx
 
Telecom1.ppt
Telecom1.pptTelecom1.ppt
Telecom1.ppt
 
FactorAnalysis.ppt
FactorAnalysis.pptFactorAnalysis.ppt
FactorAnalysis.ppt
 
Time Series Analysis_slides.pdf
Time Series Analysis_slides.pdfTime Series Analysis_slides.pdf
Time Series Analysis_slides.pdf
 
Image captions.pptx
Image captions.pptxImage captions.pptx
Image captions.pptx
 
NNAF_DRK.pdf
NNAF_DRK.pdfNNAF_DRK.pdf
NNAF_DRK.pdf
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 
prace_days_ml_2019.pptx
prace_days_ml_2019.pptxprace_days_ml_2019.pptx
prace_days_ml_2019.pptx
 

Recently uploaded

VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Genetic Algorithms.ppt

  • 2. Learning Study of processes that lead to self- improvement of machine performance. It implies the ability to use knowledge to create new knowledge or integrating new facts into an existing knowledge structure Learning typically requires repetition and practice to reduce differences between observed and actual performance 2
  • 3. Learning Definition: A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience. 3
  • 4. Learning & Adaptation 4 • ”Modification of a behavioral tendency by expertise.” (Webster 1984) • ”A learning machine, broadly defined as any device whose actions are influenced by past experiences.” (Nilsson 1965) • ”Any change in a system that allows it to perform better the second time on repetition of the same task or on another task drawn from the same population.” (Simon 1983)
  • 5. Negative Features of Human Learning Its slow (5-6 years for motor skills 12-20 years for abstract reasoning) Inefficient Expensive There is no copy process Learning strategy is often a function of knowledge available to learner 5
  • 6. Applications of ML Learning to recognize spoken words Learning to drive an autonomous vehicle Learning to classify objects Learning to play world-class backgammon Designing the morphology and control structure of electro- mechanical artefacts 6
  • 7. Different kinds of learning… Supervised learning: Someone gives us examples and the right answer for those examples We have to predict the right answer for unseen examples Unsupervised learning: We see examples but get no feedback We need to find patterns in the data Reinforcement learning: We take actions and get rewards Have to learn how to get high rewards
  • 8. Learning with a Teacher  supervised learning  knowledge represented by a set of input-output examples (xi,yi)  minimize the error between the actual response of the learner and the desired response 8 Environment Teacher Learning system state x S desired response actual response error signal + -
  • 9. Unsupervised Learning  self-organized learning  no teacher  task independent quality measure  identify regularities in the data and discover classes automatically 9 Environment Learning system state
  • 10. Learning by Examples 10 Sky Temp Humi d Wind Water Fore- cast Enjoy Sport Sunny Sunny Rainy Sunny Warm Warm Cold Warm Norma l High High High Strong Strong Strong Strong Warm Warm Warm Cool Same Same Chane Chane Yes Yes No Yes Concept: ”days on which my friend Aldo enjoys his favourite water sports” Task: predict the value of ”Enjoy Sport” for an arbitrary day based on the values of the other attributes
  • 11. Decision trees high Income? yes no NO yes no NO Criminal record? YES
  • 12. Constructing a decision tree, one step at a time address? yes no +a, -c, +i, +e, +o, +u: Y -a, +c, -i, +e, -o, -u: N +a, -c, +i, -e, -o, -u: Y -a, -c, +i, +e, -o, -u: Y -a, +c, +i, -e, -o, -u: N -a, -c, +i, -e, -o, +u: Y +a, -c, -i, -e, +o, -u: N +a, +c, +i, -e, +o, -u: N -a, +c, -i, +e, -o, -u: N -a, -c, +i, +e, -o, -u: Y -a, +c, +i, -e, -o, -u: N -a, -c, +i, -e, -o, +u: Y +a, -c, +i, +e, +o, +u: Y +a, -c, +i, -e, -o, -u: Y +a, -c, -i, -e, +o, -u: N +a, +c, +i, -e, +o, -u: N criminal? criminal? -a, +c, -i, +e, -o, -u: N -a, +c, +i, -e, -o, -u: N -a, -c, +i, +e, -o, -u: Y -a, -c, +i, -e, -o, +u: Y +a, -c, +i, +e, +o, +u: Y +a, -c, +i, -e, -o, -u: Y +a, -c, -i, -e, +o, -u: N +a, +c, +i, -e, +o, -u: N income? +a, -c, +i, +e, +o, +u: Y +a, -c, +i, -e, -o, -u: Y +a, -c, -i, -e, +o, -u: N yes no yes no yes no Address was maybe not the best attribute to start with…
  • 13. Different approach: nearest neighbor(s) Next person is -a, +c, -i, +e, -o, +u. Will we get paid back? Nearest neighbor: simply look at most similar example in the training data, see what happened there +a, -c, +i, +e, +o, +u: Y (distance 4) -a, +c, -i, +e, -o, -u: N (distance 1) +a, -c, +i, -e, -o, -u: Y (distance 5) -a, -c, +i, +e, -o, -u: Y (distance 3) -a, +c, +i, -e, -o, -u: N (distance 3) -a, -c, +i, -e, -o, +u: Y (distance 3) +a, -c, -i, -e, +o, -u: N (distance 5) +a, +c, +i, -e, +o, -u: N (distance 5) Nearest neighbor is second, so predict N k nearest neighbors: look at k nearest neighbors, take a vote E.g., 5 nearest neighbors have 3 Ys, 2Ns, so predict Y
  • 14. Approaches to Machine Learning Numerical approaches Build numeric model with parameters based on successes Structural approaches Concerned with the process of defining relationships by creating links between concepts 14
  • 15. Learning methods Decision rules: If income < $30.000 then reject Bayesian network: P(good | income, credit history,….) Neural Network: Nearest Neighbor: Take the same decision as for the customer in the data base that is most similar to the applicant 15
  • 16. 16 Classification  Assign object/event to one of a given finite set of categories.  Medical diagnosis  Credit card applications or transactions  Fraud detection in e-commerce  Worm detection in network packets  Spam filtering in email  Recommended articles in a newspaper  Recommended books, movies, music, or jokes  Financial investments  DNA sequences  Spoken words  Handwritten letters  Astronomical images
  • 17. 17 Problem Solving / Planning / Control Performing actions in an environment in order to achieve a goal. Solving calculus problems Playing checkers, chess, or backgammon Balancing a pole Driving a car or a jeep Flying a plane, helicopter, or rocket Controlling an elevator Controlling a character in a video game Controlling a mobile robot
  • 18. Another Example: Handwriting Recognition Background concepts: Pixel information Categorisations: (Matrix, Letter) pairs Both positive & negative Task Correctly categorise An unseen example Into 1 of 26 categories  Positive: – This is a letter S:  Negative: – This is a letter Z:
  • 19. Genetic Algorithm Genetic Algorithms have been applied successfully to a variety of AI applications For example, they have been used to learn collections of rules for robot control. Genetic Algorithms and genetic programming are called Evolutionary Computation
  • 20. Theory of Evolution Every organism has unique attributes that can be transmitted to its offspring Selective breeding can be used to manage changes from one generation to the next Nature applies certain pressures that cause individuals to evolve over time
  • 21. Genetic Algorithms (GAs) and Genetic Programming (GP) Genetic Algorithms Optimising parameters for problem solving Represent the parameters in the solution(s) As a “bit” string normally, but often something else Evolve answers in this representation Genetic Programming Representation of solutions is richer in general Solutions can be interpreted as programs Evolutionary process is very similar
  • 22. GA Genetic algorithms provide an AI method by an analogy of biological evolution It constructs a population of evolving solutions to solve the problem
  • 23. Genetic Algorithms What are they? Evolutionary algorithms that make use of operations like mutation, recombination, and selection Uses? Difficult search problems Optimization problems Machine learning Adaptive rule-bases
  • 24. Classical GAs  Representation of parameters is a bit string Solutions to a problem represented in binary 101010010011101010101  Start with a population (fairly large set) Of possible solutions known as individuals  Combine possible solutions by swapping material Choose the “best” solutions to swap material between and kill off the worse solutions This generates a new set of possible solutions  Requires a notion of “fitness” of the individual Base on an evaluation function with respect to the problem
  • 26. Genotype space = {0,1}L Phenotype space Encoding (representation) Decoding (inverse representation) 011101001 010001001 10010010 10010001 Representation
  • 27. GA Representation Genetic algorithms are represented as gene Each population consists of a whole set of genes Using biological reproduction, new population is created from old one.
  • 28. The Initial Population Represent solutions to problems As a bit string of length L Choose an initial population size Generate length L strings of 1s & 0s randomly Strings are sometimes called chromosomes Letters in the string are called “genes” We call the bit-string “individuals”
  • 29. Initialization Initial population must be a representative sample of the search space Random initialization can be a good idea (if the sample is large enough)
  • 30. The gene Each gene in the population is represented by bit strings. 001 10 10 Outlook Wind play tennis 0011010
  • 31. Gene Example The idea is to use a bit string to describe the value of attribute The attribute Outlook has 3 values (sunny, overcast, raining) So we use 3 bit length to represent attribute outlook 010 represent the outlook = overcast
  • 32. GA The fitness function evaluates each solution and decide it will be in next generation of solutions
  • 33. Selection Want to to give preference to “better” individuals to add to mating pool If entire population ends up being selected it may be desirable to conduct a tournament to order individuals in population Would like to keep the best in the mating pool and drop the worst
  • 34. Selection methods Common selection methods used in GAs are Fitness Proportionate Selection Rank Selection Tournament Selection
  • 35. Rank Selection All individuals are sorted according to their fitness. Each individual is then assigned a probability of being selected from some prior probability density.
  • 36.  Main idea: better individuals get higher chance Chances proportional to fitness Implementation: roulette wheel technique Assign to each individual a part of the roulette wheel  Spin the wheel n times to select n individuals Selection fitness(A) = 3 fitness(B) = 1 fitness(C) = 2 A C 1/6 = 17% 3/6 = 50% B 2/6 = 33%
  • 37. Roulette Wheel Selection 1 2 3 1 3 5 1 2 0 18 2 1 3 4 5 6 7 8 Rnd[0..18] = 7 Chromosome4 Parent1 Rnd[0..18] = 12 Chromosome6 Parent2
  • 38. Tournament Selection Select a group of N (N>1) members. Select the fittest member of this group and discard the rest.
  • 39. New Population To build new population from old one we use genetic operators to evolve the population of solutions Genetic operators are Crossover operator Mutation operator Production operator
  • 40. Crossover operator It produces two new offspring from two parent strings by copying selected bits from each parent. 11101001000 00001010101 00001001000 11101010101
  • 41. Crossover In sexual reproduction the genetic codes of both parents are combined to create offspring Would like to keep 60/40 split between parent contributions 95/5 splits negate the benefits of crossover (too much like asexual reproduction)
  • 42. Mutation operator It produces offspring from single parent by small random change in bit string. 11101001000 11100001000
  • 43. Mutation Mutation is important for maintaining diversity in the genetic code In humans, mutation was responsible for the evolution of intelleigence Example: The occasional (low probably) alteration of a bit position in a string
  • 44. Replacement Determine when to insert new offspring into the population and which individuals to drop out based on fitness Steady state evolution calls for the same number of individuals in the population, so each new offspring processed one at a time so fit individuals can remain a long time
  • 45. The Termination Check  Termination may involve testing whether an individual solves the problem to a good enough standard  Not necessarily having found a definitive answer  Alternatively, termination may occur after a fixed time  Or after a fixed number of generations  Note that the best individual in a population  So, your GA should:  Record the best from each generation  Output the best from all populations as the answer
  • 46. Why use genetic algorithms? They can solve hard problems Easy to interface genetic algorithms to existing simulations and models GA’s are extensible GA’s are easy to hybridize GA’s work by sampling, so populations can be sized to detect differences with specified error rates Use little problem specific code
  • 47. Example No. A1 A2 Classification 1 T T + 2 T T + 3 T F - 4 F F + 5 F T - 6 F T -
  • 48. Representation A1 ={T, F}  10 = T && 01 = F A2={T, F}  10 = T && 01 = F Classification = {+, -}  1 = + && 0 = - The gene is A1 (2) + A2 (2) +Classification (1) = 5 bits [1 0 1 0 1] A1= T & A2=T & Classification = +
  • 49. Initial Population Let we construct 10 genes randomly as [11101] fitness = 4 cases { 2 true and 2 false}=0.5 [10001] fitness = 0.66 [01011] fitness = 0.0 [01011] [01111] [11111] [01000] [00001] [11110] [01100]
  • 50. Crossover operation [11101] X [01100][11100] + [01101] [01011] X [10001]  [11001] + [01010]
  • 51. Mutation Operation [01011]  [01010] [11111]  [11011]
  • 53. GA Application Searching maximum of function Search for value of x to y=f(x) be maximum. X play the role of genes, binary code of x value in 8 bits gene (chromosome) Y the role of fitness
  • 54. GA Application Given the digits 0 through 9 and operators +, -, *, and /. Find sequence that represent given target number. E.g. Given number 23, the sequence +6+5*4/2+1 If number is 75.5, then 5/2+9*7-5
  • 55. GA Application Four bits are required to represent char 0:0000, …….9:1001, +:1010, -:1011, *:1100, /:1101 Gene:0110101001011100010011010010 10100001 is 6+5*4/2+1 = 23
  • 56. TSP Application Use a genetic algorithm to solve the traveling salesman problem we could begin by creating a population of candidate solutions We need to define mutation, crossover, and selection methods to aid in evolving a solution from this population
  • 57. Related Technologies Genetic Programming Existing programs are combined to breed new programs Artificial Life Using cellular automata to simulate population growth
  • 58. Automatic Programming Getting software to write software Brilliant idea, but turned out to be very difficult Intuitively, should be easier than other tasks The automatic programming community Didn’t deliver on early promises So people began to avoid this area And “Automated Programming” became words of warning
  • 59. Questions to be Answered  How is the programming task specified?  How are the ingredients chosen/specified/  How do we represent programs?  Which enables reproduction, evaluation, etc.  How are individuals chosen for reproduction?  How are offspring produced?  How are termination conditions specified?  We will start by looking at the representation of programs, as this is required to answer many questions
  • 60. Genetic Programming It same as GA but the gene is tree Each tree = computer program It contain a population of computer programs to solve the problem specifically
  • 61. A Tree Representation  Idea: represent programs as trees  Each node is either a function or a terminal  Functions  Examples: add, multiply, square root, sine, cosine  Problem specific ones: getPixel(), goLeft()  Terminals  Constants and variables, e.g., 10, 17, X, Y  The nodes below a function node  Are the inputs to that function  The node itself represents the output from the function  As input to the parent node  The nodes at the ends of branches are terminals only
  • 62. Computer Programs as Trees Infix/Postfix (2 + a)*(4 - num) * + - 2 a 4 num
  • 63. “Breeding” Computer Programs Start off with a large “pool” of random computer programs. Need a way of coming up with the best solution to the problem using the programs in the “pool” Based on the definition of the problem and criteria specified in the fitness test, mutations and crossovers are used to come up with new programs which will solve the problem.
  • 64. Tree based representation Trees are a universal form, e.g. consider Arithmetic formula Logical formula Program            1 5 ) 3 ( 2 y x  (x  true)  (( x  y )  (z  (x  y))) i =1; while (i < 20) { i = i +1 }
  • 66. Tree based representation (x  true)  (( x  y )  (z  (x  y)))
  • 67. Tree based representation i =1; while (i < 20) { i = i +1 }
  • 68. Mutation Most common mutation: replace randomly chosen subtree by randomly generated tree
  • 70. Child 2 Parent 1 Parent 2 Child 1 Crossover operation
  • 71.
  • 72. Application Domain #1 Evolving Electronic Circuits  John Koza Stanford Professor and CEO of “Genetic Programming Inc.” Guru of Genetic Programming, very successful Made GP more mainstream by his success  Particularly fruitful area: Producing designs for circuit diagrams E.g., antennas, amplifiers, etc. Functions mimic how transistors, resistors, etc. work
  • 73. GP Application 1 Given the digits 0 through 9 and operators +, -, *, and /. Find sequence that represent given target number. Given number 23, the sequence +6+5*4/2+1 If number is 75.5, then 5/2+9*7-5
  • 74. Generate Random Programs Generate well-formed formulas using prefix notation from variable A and a set of function symbols, for example { +, -, *, %, sqrt } Examples: ( + A ( * ( sqrt A ) A ) ) (* A (- (* A A) (sqrt A) ) )
  • 75. Examples of Genetic Programs Symbolic Regression - the process of discovering both the functional form of a target function and all of its necessary coefficients, or at least an approximation to these. Analog circuit design - Embryo circuit - Initial circuit which is modified to create a new circuit according to functionality criteria.