Lecture Notes SC
Lecture Notes SC
Artificial Neuron
NNs learn relationship between cause and effect or • Neural network: information processing
organize large volumes of data into orderly and paradigm inspired by biological nervous
informative patterns.
It’s a frog systems, such as our brain
frog
• Structure: large number of highly interconnected
processing elements (neurons) working together
lion
• Like people, they learn from experience (by
bird example)
What is that?
6 7
Biological Neural Networks Biological Neural Networks
Artificial Neurons
Artificial Neuron
13
Model Of A Neuron
• A neural net consists of a large number of
Wa
simple processing elements called neurons,
X1 units, cells or nodes.
Wb Y
X2 f()
• Each neuron is connected to other neurons by
means of directed communication links, each
Wc
X3 with associated weight.
y
• 1949 Hebb‟s law
Axon
x2 w2 Activation Function:
• 1958 Perceptron (Rosenblatt)
yin = x1w1 + x2w2 (y-in) = 1 if y-in >=
and (y-in) = 0 • 1960 Adaline, better learning rule (Widrow,
Dendrite Huff)
• 1969 Limitations (Minsky, Papert)
-A neuron receives input, determines the strength or the weight of the input, calculates the total
weighted input, and compares the total weighted with a value (threshold)
18 19
Characterization
• 1977 Brain State in a Box (Anderson) • Architecture
• 1982 Hopfield net, constraint satisfaction – a pattern of connections between neurons
• Single Layer Feedforward
• 1985 ART (Carpenter, Grossfield) • Multilayer Feedforward
• Recurrent
• 1986 Backpropagation (Rumelhart, Hinton, • Strategy / Learning Algorithm
McClelland) – a method of determining the connection weights
• Supervised
• 1988 Neocognitron, character recognition • Unsupervised
• Reinforcement
(Fukushima) • Activation Function
– Function to compute output signal from input signal
20 21
V11
x1
w11
x1 w12
w11 V1n
w12 y1
x2 z2
w12 ym
y2
w21
yn zn
x2
Input layer
w22
output layer xm Vmn
Input layer Output layer
Contoh: ADALINE, AM, Hopfield, LVQ, Perceptron, SOFM Hidden layer
22 Contoh: CCN, GRNN, MADALINE, MLFF with BP, Neocognitron, RBF, RCE
23
Hidden nodes
• Targets are not provided • Target is provided, but the desired output is absent.
• Appropriate for clustering task • The net is only provided with guidance to determine the
– Find similar groups of documents in the web, content produced output is correct or vise versa.
addressable memory, clustering.
• Weights are modified in the units that have errors
• Neural Network models: Kohonen, self organizing maps,
Hopfield networks.
26 27
f(x) = 0 otherwise 0 1 0 0 1 1
0 0 0
• Binary sigmoid 0 0 0
f(x) = 1 / (1 + e-sx)
• Bipolar sigmoid
f(x) = -1 + 2 / (1 + e-sx)
• Hyperbolic tangent
f(x) = (ex – e-x) / (ex + e-x)
28 29
30 31
Who is interested?... Problem Domains
• Electrical Engineers – signal processing, • Storing and recalling patterns
control theory • Classifying patterns
• Computer Engineers – robotics • Mapping inputs onto outputs
• Computer Scientists – artificial • Grouping similar patterns
intelligence, pattern recognition • Finding solutions to constrained
• Mathematicians – modelling tool when optimization problems
explicit relationships are unknown
32 33
Coronary Clustering
Disease
Classification 00 11
10
11 10
STOP
01 10 11
Neural
11 00
Net 11 10 00 00 Input patterns
00 11
Input layer
Output layer 00
01
00 01 10 11
Sorted
00 10 11 patterns
.
00 11 34 35
• Signal processing
• Pattern recognition, e.g. handwritten
Medical Applications
characters or face identification.
• Diagnosis or mapping symptoms to a
medical case.
Information
Chemistry
Searching & retrieval • Speech recognition
• Human Emotion Detection
• Educational Loan Forecasting
Education
37
Business & Management
Abdominal Pain Prediction Voice Recognition
Intensity Duration
Male Age Temp WBC Pain Pain
adjustable
1 20 37 10 1 1
weights
38 39
INPUT-OUTPUT MAPPING
It can derive a relationship between a set of input & output
responses
ADAPTIVITY
The ability to learn allows the network to adapt to changes in
the surrounding environment
EVIDENTIAL RESPONSE
It can provide a confidence level to a given solution
40 41
FAULT TOLERANCE
Distributed nature of the NN gives it fault tolerant capabilities
NEUROBIOLOGY ANALOGY
Models the architecture of the brain
42 43
Weight Vectors in Clustering Networks
1 wk1
wk2
2
wk3 k
UNIT-2 3 wk4
4
ASSCIATIVE MEMORY AND • Node k represents a particular class of input vectors, and the
weights into k encode a prototype/centroid of that class.
UNSUPERVISED LEARNING • So if prototype(class(k)) = [ik1, ik2, ik3, ik4], then:
NETWORKS wkm = fe(ikm) for m = 1..4, where fe is the encoding function.
• In some cases, the encoding function involves normalization.
Hence wkm = fe(ik1…ik4).
• The weight vectors are learned during the unsupervised training
phase.
• Tasks
– Clustering - Group patterns based on similarity (Focus of this
lecture) • Topologically Organized Networks
– Vector Quantization - Fully divide up S into a small set of – Winner & its neighbors “take some”
regions (defined by codebook vectors) that also helps cluster
P.
– Probability Density Approximation - Find small set of points
whose distribution matches that of P.
– Feature Extraction - Reduce dimensionality of S by removing
I - wki
2 = Euclidean distance from input vector I to the Initial Randomly-Generated Weight Vectors:
i
i 1 vector represented by output node k‟s incoming weights [ 0.14 0.75 0.71 ]
[ 0.99 0.51 0.37 ] Hence, there are 3 classes to be learned
• Update formula: If j is the winning output node: [ 0.73 0.81 0.87 ]
Associative-Memory Networks
Associative Network Types
Input: Pattern (often noisy/corrupted) 1. Auto-associative: X = Y
Output: Corresponding pattern (complete / relatively noise-free)
Process
1. Load input pattern onto core group of highly-
interconnected neurons.
2. Run core neurons until they reach a steady state.
3. Read output off of the states of the core neurons. *Recognize noisy versions of a pattern
Inputs Outputs
2. Hetero-associative Bidirectional: X <> Y
Matrix Memory: Hebbian Principle: If all the input patterns are known prior to retrieval time,
then init weights as:
1 P 1 P
The weights must store the average correlations between all pattern components
across all patterns. A net presented with a partial pattern can then use the correlations
Auto: w jk i pki pj
P p 1
Hetero: w jk i pko pj
P p 1
to recreate the entire pattern.
Weights = Average Correlations
Auto-Associative Memory Hetero-Associative Memory
1. Auto-Associative Patterns to Remember 3. Retrieval 1. Hetero-Associative Patterns (Pairs) to Remember 3. Retrieval
• 1 node per pattern unit • 1 node per pattern unit for X & Y
• Fully connected: clique 1 2 • Full inter-layer connection
• Weights = avg correlations across • Weights = avg correlations across
all patterns of the corresponding units 3 4 all patterns of the corresponding units
Future
68 69
TRADITIONAL REPRESENTATION
OF LOGIC
WHAT IS FUZZY LOGIC?
Definition of fuzzy
Fuzzy – “not clear, distinct, or precise; blurred”
Slow Fast
Definition of fuzzy logic Speed = 0 Speed = 1
Business
Hybrid Modeling
Expert Systems
Fuzzy Logic Example Fuzzy Logic Example
Automotive Speed Controller
1.0
3 inputs: Too
Slow
Slow Optimum Fast
Too
Fast
acceleration (3 levels)
1.0
distance to destination (3 levels) Decelerating Constant Accelerating
1 output: Acceleration
Very
Close Distant
Close
values
IF speed is SLOW and acceleration is DECREASING, In practice, a system won't require all the rules.
THEN INCREASE POWER SLIGHTLY
iv ) z 5 No such case.
Syntactic rules (grammar):
A( ) B ( z ) 0 Rules for other terms such as “not small”
X X
(0,1]
Fuzzification
Fuzzy Equations
• Multiplication A X B
Fuzzification is the process of changing a real scalar value into a fuzzy
– X = B/A is not a solution. value.
This is achieved with the different types of fuzzifiers (membership
– Conditions to have a solution
functions).
For any (0,1], let A [ a1 , a2 ], B [ b1 , b2 ] and X [ x1 , x2 ]
(i) b1 / a1 b2 / a2 for any (0,1]
(ii) implies b1 / a1 b1 / a1 b2 / a2 b2 / a2
Fuzzification Fuzzification
How cool is 36 F° ?
Temp: {Freezing, Cool, Warm, Hot} It is 30% Cool and 70% Freezing
Degree of Truth or "Membership"
0.3
0
0
10 30 50 70 90 110
10 30 50 70 90 110
Temp. (F°)
Temp. (F°)
Membership Functions
Fuzzification Fuzzification
Membership Functions Membership Functions
The MATLAB toolbox includes 11 built-in membership function Two membership functions are built on the Gaussian distribution
types. These 11 functions are, in turn, built from several basic curve: a simple Gaussian curve and a two-sided composite of two
functions: different Gaussian curves. The two functions are gaussmf and
gauss2mf. The generalized bell membership has the function name
• piecewise linear functions
gbellmf.
• the Gaussian distribution function
• the sigmoid curve Because of their smoothness and concise notation, Gaussian and bell
membership functions are popular methods for specifying fuzzy sets.
• quadratic and cubic polynomial curves Both of these curves have the advantage of being smooth and nonzero
at all points.
Fuzzification Fuzzification
Membership Functions Membership Functions
Although the Gaussian membership functions and bell membership Polynomial based curves account for several of the membership
functions achieve smoothness, they are unable to specify asymmetric functions in the toolbox.
membership functions, which are important in certain applications. Three related membership functions are the Z, S, and Pi curves, all
named because of their shape. The function zmf is the asymmetrical
the sigmoidal membership function is defined, which is either open polynomial curve open to the left, smf is the mirror-image function
left or right. Asymmetric and closed (i.e. not open to the left or right) that opens to the right, and pimf is zero on both extremes with a rise
membership functions can be synthesized using two sigmoidal in the middle.
functions, so in addition to the basic sigmf, you also have the
difference between two sigmoidal functions, dsigmf, and the product
of two sigmoidal functions psigmf.
Introduction
• After scientists became disillusioned with
classical and neo-classical attempts at
modeling intelligence, they looked in other
Unit -5 directions.
• Two prominent fields arose, connectionism
GENETIC ALGORITHRMS (neural networking, parallel processing)
and evolutionary computing.
• It is the latter that this essay deals with -
genetic algorithms and genetic
programming.
What is GA What is GA
• A genetic algorithm (or GA) is a search • Genetic algorithms are implemented as a
technique used in computing to find true or computer simulation in which a population of
approximate solutions to optimization and abstract representations (called chromosomes
search problems. or the genotype or the genome) of candidate
solutions (called individuals, creatures, or
• Genetic algorithms are categorized as global phenotypes) to an optimization problem evolves
search heuristics. toward better solutions.
• Genetic algorithms are a particular class of
evolutionary algorithms that use techniques • Traditionally, solutions are represented in binary
inspired by evolutionary biology such as as strings of 0s and 1s, but other encodings are
inheritance, mutation, selection, and crossover also possible.
(also called recombination).
What is GA Key terms
• The new population is then used in the • Individual - Any possible solution
next iteration of the algorithm. • Population - Group of all individuals
• Commonly, the algorithm terminates when • Search Space - All possible solutions to the
either a maximum number of generations problem
has been produced, or a satisfactory • Chromosome - Blueprint for an individual
fitness level has been reached for the • Trait - Possible aspect (features) of an individual
population. • Allele - Possible settings of trait (black, blond,
etc.)
• If the algorithm has terminated due to a
maximum number of generations, a • Locus - The position of a gene on the
chromosome
satisfactory solution may or may not have
• Genome - Collection of all chromosomes for an
been reached. individual
• Phenotype:
– Physical characteristic of the genotype
(smart, beautiful, healthy, etc.)
Example Cont‟d
• Create next generation of solutions
– Probability of “being a parent” depends on the fitness.
• Ways for parents to create next generation
– Reproduction
• Use a string again unmodified.
– Crossover
• Cut and paste portions of one string to another.
– Mutation
• Randomly flip a bit.
– COMBINATION of all of the above.