0% found this document useful (0 votes)
58 views30 pages

Artificial Intelligence in Robotics-21-50

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views30 pages

Artificial Intelligence in Robotics-21-50

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

There are two ways to implement Genetic Algorithm (GA).

That is binary and


continuous. Both algorithms follow the

4
5
Example:

Example:

6
Artificial Intelligence in Robotics
(Lecture 12)

4thyear, Mechatronics and Robotics


Engineering
1st Semester

By:
Dr. Mohammed Y. Hassan

Control and Systems Engineering Department


University of Technology - Iraq

1
Genetic Algorithm

2
3
4
Example:

Example:

5
6
Example:

7
8
Artificial Intelligence in Robotics
(Lecture 2)

4thyear, Mechatronics and Robotics


Engineering
1st Semester
By:
Dr. Mohammed Y. Hassan

Control and Systems Engineering Department


University of Technology - Iraq

1
Lecture 2
Neural Network (NN)
Introduction:
Computers are extremely fast and precise in executing sequences of
instructions that have been formulated for them. A human information processing
system is composed of neurons switching at a speed about a million times slower
than computer gates. In the contrary, humans are more efficient than computers at
computationally complex tasks such as speech and pattern recognition.

Figure Information flow in nervous system.

Artificial neural networks:


Artificial neural networks (or it can also be called neural networks) are “cellular
systems which acquire, store, and utilize experimental knowledge. The knowledge
is in the form of stable states or mapping embedded in the networks that can be
recalled by the user”.
It has the ability to reproduce some of the flexibility and power of the human
brain by artificial means. Neural networks must be taught or trained to learn new
associations and new patterns. Learning corresponds to parameter changes.
Learning rules and algorithms used for experimental training of networks replace
the programming required for conventional computation.
Neural network users do not specify an algorithm to be executed by each
computing node as would programmers of a more traditional machine. Instead, they
select what in their view is the best architecture, specify the characteristics of the
neurons and initial weights, and choose the training mode for the network.
Appropriate inputs are then applied to the network so that it can acquire knowledge
from the environment. As a result of such exposure, the network assimilates the
information that can later be recalled by the user. Network computation is
performed by a dense mesh of computing nodes and connections. They operate

2
collectively and simultaneously on most or all data and inputs.

Biological Neurons:
A human brain consists of approximately 10" computing elements called
neurons. They communicate through a connection network of axons and synapses
having a density of approximately synapses per neuron.
 Neurons communicate with each other by means of electrical impulses. The
neurons operate in a chemical environment that is even more important in terms
of actual brain behaviour.
 The input to the network is provided by sensory receptors. Receptors deliver
stimuli both from within the body, as well as from sense organs when the stimuli
originate in the external world.
 As a result of information processing in the central nervous systems, the effectors
are controlled and give human responses in the form of diverse actions.
 The elementary nerve cell, called a neuron, is the fundamental building block of
the biological neural network.

Figure. Structure of a neuron.

 A typical cell has three major regions: the cell body, which is also called
the soma, the axon, and the dendrites.
 Dendrites form a dendrites tree, which is a very fine bush of thin fibbers
around the neuron's body. They receive information from neurons through

3
axons-long fibres that serve as transmission lines.
 An axon is a long cylindrical connection that carries impulses from the
neuron. The end part of an axon splits into a fine arborisation. Each branch
of it terminates in a small end bulb almost touching the dendrites of
neighbouring neurons.
 The axon-dendrite contact organ is called a synapse. The synapse is where
the neuron introduces its signal to the neighbouring neuron. The signals
reaching a synapse and received by dendrites are electrical impulses.
 The inter-neuronal transmission is sometimes electrical but is usually
affected by the release of chemical transmitters at the synapse. Thus,
terminal buttons generate the chemical that affects the receiving neuron.
 The receiving neuron either generates an impulse to its axon, or produces
no response.
 The neuron is able to respond to the total of its inputs aggregated within a short
time interval called the period of latent summation.
 The neuron's response is generated if the total potential of its membrane reaches
a certain level. Specifically, the neuron generates a pulse response and sends it
to its axon only if the conditions necessary for firing are fulfilled.
 Incoming impulses can be excitatory if they cause the firing, or inhibitory if
they hinder the firing of the response. A more precise condition for firing is that
the excitation should exceed the inhibition by the amount called the threshold of
the neuron, typically a value of about 40mV
 Since a synaptic connection causes the excitatory or inhibitory reactions of the
receiving neuron, it is practical to assign positive and negative unity weight
values, respectively, to such connections.
 This allows us to reformulate the neuron's firing condition. The neuron fires
when the total of the weights to receive impulses exceeds the threshold value
during the latent summation period.
 After carrying a pulse, an axon fibre is in a state of complete non-excitability for
a certain time called the refractory period. For this time interval the nerve does
not conduct any signals, regardless of the intensity of excitation.
 Thus, we may divide the time scale into consecutive intervals, each equal to the
length of the refractory period. This will enable a discrete-time description of
the neurons' performance in terms of their states at discrete time instances.

Applications of Neural Network:


Neural networks are useful and applicable for solving real world problems, like:
1. Pattern recognition. (Like Image processing, speech recognition,
robotics...etc)
2. Risk assessment.
3. Diagnostics (in medicine, engineering, manufacturing ... etc).
4. Data compression.
4
5. Optimization (Like sales man route).
6. Addressable memories.
7. Control.
8. Weather Forecasting.

Elements and modeling of neural networks:


The basic processing elements of Neural Network are called neurons or
nodes. Neurons perform as summing and nonlinear mapping junctions. In some
cases they can be considered as threshold units that fire when their total input
exceeds certain bias levels. They are often organized in layers and feedback
connections both within layer and towards adjacent layers are also allowed. The
strength of each connection is expressed by a numerical value called a weight,
which can also be modified. Neurons usually operate in parallel and are configured
in regular architectures.

Figure. General symbol of a neuron.

The signal flow of neuron inputs, Xi, is considered to be unidirectional as indicated


by arrows, as is a neuron's output signal flow. This symbolic representation, Figure
above, shows a set of weights and the neuron's processing unit, or node. The
neuron output signal is given by the following relationship:
,
or
∑ ,
where w is the weight vector defined as:
[ ]
and
[ ]
x is the input vector.
The function is often referred to as an activation function. Its domain is
the set of activation values, net, of the neuron model, it is often written as f(net).
The variable net is defined as a scalar product of the weight and input vector:

5
Types of Non-Linearities (Activation Functions):
Activation functions can be divided into two categories:

1) Soft-limiting (continuous ) activation functions:


Typical of these activation functions used are:
a) bipolar sigmoid:
-1,

Figure. Bipolar Sigmoid activation function.

where  > 0 is proportional to the neuron gain determining the steepness of


the continuous function f( net) near net=0.

b) Unipolar sigmoid:
By shifting and scaling the bipolar activation function, a unipolar
continuous activation function can be obtained:

Figure. Unipolar Sigmoid activation function.

c) Linear:
A linear function can also be used as an activation function:

6
Figure. Example of a linear activation function.

2) Hard-limiting (binary) activation functions:


a) Bipolar binary:
As in the bipolar continuous activation function, the bipolar binary
activation function is obtained:
{

Figure. Example of a Bipolar binary activation function.

b) Unipolar binary:
As in the unipolar continuous activation function, the bipolar binary
activation function is obtained:
{

Figure. Example of a unipolar binary activation function.


Note:
Any function, f(net), that is monotonically increasing and continuous such that
can be used instead.

7
Types of Neural Networks (NNs):
Neural networks can be defined as an interconnection of neurons such that
neurons outputs are connected through weights to all other neurons including
themselves; both lag-free and delay connections are allowed. Therefore; one can
define two general types of artificial neural networks:

a) Feed-forward neural networks:


The mapping of an input pattern into an output pattern in the feed-forward
neural network is of feed-forward and instantaneous type, since it involves no
time delay between the input and output.

Figure. Muti-layer Feed-forward neural network.

b) Feedback neural network:


It is obtained from the feed-forward one by connecting the neuron’s output to
their inputs. In this case, the present output, o(t), controls the output at the
following instant o(t+). This network is also called Recurrent neural network.

Figure. Feedback neural network.

8
Artificial Intelligence in Robotics
(Lecture 3)

4thyear, Mechatronics and Robotics


Engineering
1st Semester
By:
Dr. Mohammed Y. Hassan

Control and Systems Engineering Department


University of Technology - Iraq

1
Neural network Recall:
The process of computation of the output response (o) for a given input (x)
performed by the network is known as recall.
 Recall is the proper processing phase for a neural network and its objective is
to retrieve the information.
 Recall corresponds to the decoding of the stored content which may have
been encoded in a network previously.

Types of recall patterns:


 Autoassociation.
If a set of patterns can be stored, then if the network is presented with a
pattern similar to a member of the stored set, it may associate the input with
the closest stored pattern. The process is called autoassociation.

Figure. Autoassociation.

 Hetroassociation:
In hetroassociation processing, the association between pairs of patterns are
stored.

Figure. Hetroassociation.
 Classification:
If a set of input patterns is divided into a number of class or categories, then
in response to an input pattern, the classifier should recall the information
regarding class membership of the input pattern. Typically, classes are
expressed by discrete-values output vectors, and thus output neurons of
classifiers would employ binary activation functions.

Figure. Classification .
2
 Generalization:
One of the distinct strengths of neural networks is their ability to generalize.
The network is said to generalize well when it sensibly interpolates input
patterns that are new to the network.

Figure. Generalization.

Supervised and unsupervised Learning modes:


Learning is necessary when the information about inputs/outputs is unknown or
incomplete, so that no design of a network can be performed in advance. The
majority of the neural networks covered in lectures require training in supervised
or unsupervised learning modes:

 Supervised learning mode:


In this type of learning we assume that at each instant of time when the input
(X) is applied, the desired response (d) (teacher or supervisor) of the input is
provided.

Figure. Supervised learning algorithm.


The distance between the actual and desired response serves as an error measure
and is used to correct network parameters externally (weights and biases) so that
the error decreases. Since we assume adjustable weights, the teacher may
implement a reward-and-punishment scheme to adapt the network’s weight
matrix (W).

 Unsupervised learning mode (learning without teacher):


In this mode of learning, the desired response is not known; thus, explicit error
information cannot be used to improve network behaviour. Since no

3
information is available as to correctness or incorrectness of responses,
learning must be somehow be accomplished based on observations of
responses to inputs that we have marginal or no knowledge about.

Figure. Unsupervised learning algorithm.

Unsupervised learning algorithms use patterns that are typically redundant


raw data having no labels regarding their class membership, or
associations. In this mode of learning, the network must discover for itself
any possibly existing patterns, regularities, separating properties, ...etc.
while discovering these, the network undergoes change of its parameters
which is called self-organization.

 Learning with supervision corresponds to classroom learning with the


teacher’s questions answered by students and corrected, if needed, by the
teacher.
 Learning without supervision corresponds to leaning the subject from
videotape lecture covering the material but not including any other teacher’s
involvement. Therefore, the student cannot get explanations of unclear
questions, check answers and become fully informed.

Learning rules:
A neuron is considered to be an adaptive element. Its weights are modified
depending on the input signal, its output value, and the associated teacher response.
In some cases, the teacher signal is not available and no error information can be
used (unsupervised learning method).
For the neural network shown below, the jth input can be an output of another
neuron or it can be an external input. Under different learning rules, the form of the
neuron’s activation function may be different. Note that the threshold parameter
may be included in learning as one of the weights. This would require fixing one of
the inputs, say , (Ex.: -1).

4
Figure. Single neuron

There are several methods used to train the neural network, in the following is
the explanation of three methods; i.e Hebbian learning rule (Any (Binary and
continuous) unsupervised learning), Perceptron learning rule (Binary supervised
learning) and Delta rule (continuous supervised learning).

5
Example:
Assume the network shown in figure below;

illustrate one epoch, (one iteration for each pattern), Hebbian learning with
bipolar binary activation function assuming learning rate of (c=1) with the input
and initial weight vectors are:

Where the set of three training vectors are:

6
Solution:
Note: Since the initial weights are of non-zero value, the network has apparently
been trained beforehand.
The bipolar binary activation function is: ( ) ( ) {

7
Note: The iteration process stops either the required number of epochs achieved
or all the updated weights are not changed for one epoch.

Example:
Repeat solving the previous example assuming the activation function is bipolar
continuous bipolar sigmoid activation function. Assume λ=1.
Solution:
The bipolar sigmoid activation function is:
( ) -1,

8
Note: The student must give detailed solution in Exams.

Homework 1:
1. Iterate the previous two examples for the second epoch and check where the
weights have changed.
2. Write a MATLAB program that implements Hebbian learning rule.

9
Artificial Intelligence in Robotics
(Lecture 4)

4thyear, Mechatronics and Robotics


Engineering
1st Semester
By:
Dr. Mohammed Y. Hassan

Control and Systems Engineering Department


University of Technology - Iraq

1
\

You might also like