Applications of AI
Applications of AI
Applications of AI
Applications of AI
6.1.1 Neural network
• A neuron is a cell in brain whose principle function is the collection,
Processing, and dissemination of electrical signals.
• Brains Information processing capacity comes from networks of such
neurons.
• Due to this reason some earliest AI work aimed to create such artificial
networks. (Other Names are Connectionism; Parallel distributed processing
and neural computing)
Biological neuron vs ANN
Application of AI 3
Biological neuron
Application of AI 4
Units of Neural Network
Nodes(units):
Nodes represent a cell of neural network.
Links:
Links are directed arrows that show propagation of information from one
node to another node.
Activation:
Activations are inputs to outputs from unit.
Weight:
Each link has weight associated with it which determines strength and sign
of the connection
Application of AI 5
Cont..
Activation function:
A function which is used do derive output activation from the input
activations to a given node is called activation function.
Bias Weight:
Bias weight is used to set the threshold for a unit. Unit is activated when
the weighted sum of real inputs exceeds the bias weight.
Application of AI 6
Artificial Neural Network(ANN)
•They are a computational tool, based on the properties of biological neural systems that
Application of AI 7
Fig: An artificial Neuron
Application of AI
8
Cont..
•Receives n inputs Multiplied by its weight(W1 , W2 ,…, Wn ) which determines the
•Outputs result
Application of AI 9
Example 1
Application of AI 10
Example 2
Application of AI 11
6.1.2 Activation Function
•It defines the output of that node given an input or set of inputs.
•It is usually an abstraction representing the rate of action potential firing in the cell.
Application of AI 12
Cont..
The activation function is designed to meet two criteria:
1. We want the node(unit) to be “active” (near+1) when the “right ” input is
given, and “inactive”(near 0) when the “wrong” input is given.
2. The activation needs to be non-linear, otherwise the entire neural
network collapses into a single linear function.
Application of AI 13
Cont..
Although the possible number of activation functions is infinite, few of the activation
2. Ramp function
4. Sigmoid function
Application of AI 14
Linear and Non-Linear[short glimpse]
• In short if out expected output reflects the
linear regression[explore] as shown below
then linear activation functions can be used:
(Top Figure).
• But in the in the second figure below linear
function will not produce the desired
results:(Middle figure)
• However, a non-linear function as shown
below would produce the desired results:
(Bottom figure)
Application of AI 15
1. Unit Step Function
•Unary Function
•Unary function is a simple type of function where the output generated is only one .
•Such that the unary function in linear function will only produce positive numbers over
Application of AI 16
Cont..
•It is most useful for the output layer of a predictive neural network.
Here, the weighted sum input of the neuron plus a linearly dependent bias
Application of AI 17
Figure: Graph of Linear Function
Application of AI 18
•Binary Function
It is mostly used in single layer networks. The output of this function is limited to one of
the two values:
Typically the binary function produces a binary value in response to the sign of the
input, emitting +1 if x is positive and 0 if not.
Application of AI 19
Figure: Graph of Binary Function
Application of AI 20
2. Ramp Function
activation functions.
•It places the upper and lower bounds on the value of the function
Application of AI 21
The ramp function is defined by the equation:
Where y is the saturation value for the function and the points x=y and
Application of AI 22
Figure: Graph of Ramp Function
Application of AI 23
3. Piece-wise Linear Function
•It is also called saturating linear function and can have either a binary or
Application of AI 25
4. Sigmoid Function
function.
Application of AI 26
The sigmoidal transfer function can be written in the form:
Application of AI 27
Figure: Graph of Sigmoid Function
Application of AI 28
6.1.4 McCulloch and Pit model of Neural network
Application of AI 29
Cont..
• It fires when a linear combination of its inputs exceeds some threshold.
• A neural network is composed of nodes (units) connected by directed links. A
link from unit j to i serve to propagate the activation aj from j to i.
• Each link has some numeric weight Wj,i associated with it, which determines
strength and sign of connection.
• Each unit first computes a weighted sum of it’s inputs:
• Here, ai output activation from unit j and Wj,i is the weight on the link j to this
node.
Application of AI 30
Cont..
Activation function is used to:
• Activate or Deactivate the units
• Makes the activation non-linear.
If the activations are linear entire neural network collapse into linear function.
Application of AI 31
Realizing logic gates by using Neurons
• We can use McCulloch-Pitts neurons to implement the basic logic gates.
• All we need to do is find the appropriate connection weights and neuron
thresholds to produce the right outputs for each set of inputs.
• We shall see explicitly how one can construct simple networks that perform
NOT,
AND, and OR.
• It is then a well known result from logic that we can construct any logical
function from these three operations.
Application of AI 32
Cont..
Application of AI 34
Application of AI 35
Neural network Architecture
• Single-Layer Feed-forward NNs
• One input layer and one output layer of processing units. No feed-back
connections. (For example, a simple Perceptron.)
• Multi-Layer Feed-forward NNs
• One input layer, one output layer, and one or more hidden layers of
processing units. No feed-back connections. The hidden layers sit in between
the input and output layers, and are thus hidden from the outside world.(For
example, a Multi-Layer Perceptron.)
• Recurrent NNs
• Any network with at least one feed-back connection. It may, or may not, have
hidden units. (For example, a Simple Recurrent Network.)
Application of AI 36
Application of AI 37
Single-layer feed-forward neural networks
a. ADALINE
• Acronym for Adaptive Lineardi Neuron or later Adaptive Linear
Element.
• Single layer ANN
• Network uses memistors(memory devices able to perform logical
operation and data processing)
• Based on McCulloch-Pitts neuron
• Consists of weight ,a bias and a summation function
• Consists of multiple nodes where each node accepts multiple inputs
and generates one output
Application of AI 38
Cont..
Application of AI 39
Application of AI 40
Single-layer feed-forward neural networks
b. Perceptron
• A neural network in which all the inputs connected directly to the outputs is
called a single-layer neural network, or a perceptron network.
• Since each output unit is independent of the others each weight affects only
one of the outputs
• Supervised learning technique
i. Set the weight and thresholds of the neuron to random values.
ii. present an input.
iii. Calculate the output of the neuron.
iv. Alter the weights to reinforce correct decisions and discourage wrong decisions, hence reducing
the error. So for the network to learn we shall increase the weights on the active inputs when we
want the output to be active, and to decrease them when we want the output to be inactive.
v. Now present the next input and repeat steps iii. - v.
Application of AI 41
Perceptron NN
Application of AI 42
Question of the day????
• Did you point out the major differences between Adaline and
perceptron?
Application of AI 43
Multilayer neural networks (perceptrons)
• The neural network which contains input layers, output layers and
some hidden layers also is called multilayer neural network.
• The advantage of adding hidden layers is that it enlarges the space of
hypothesis (???).
• Layers of the network are normally fully connected.
Application of AI 44
Multilayer NN
Application of AI 45
• Advantage of adding Hidden layer in multilayer neural network??
• Explore:
• Underfitting and overfitting
Application of AI 46
• One of the type of Supervised Learning we left in
Chapter 5.
• Can any of you spell its name????
Application of AI 47
Back propagation Algorithm
• It is a supervised learning method, and is an implementation of the Delta
rule.
• It requires a teacher that knows, or can calculate, the desired output for any
given input.
• The term is an abbreviation for "backwards propagation of errors".
• Backpropagation requires that the activation function used by the
artificial neurons (or "nodes") is differentiable(calculate slope)
• As the algorithm's name implies, the errors (and therefore the learning)
propagate backwards from the output nodes to the inner nodes.
• So technically speaking, backpropagation is used to calculate the gradient of
the error of the network with respect to the network's modifiable weights.
Application of AI 48
Cont..
•Backpropagation usually allows quick convergence on satisfactory
local minima for error in the kind of networks to which it is suited.
•Backpropagation networks are necessarily multilayer perceptrons
(usually with one input, one hidden, and one output layer).
•In order for the hidden layer to serve any useful function, multilayer
networks must have non-linear activation functions for the multiple
layers.
Application of AI 49
Algorithm[Alternate]
•Phase 1: Propagation
•Each propagation involves the following steps:
•Forward propagation of a training pattern's input through the
neural network in order to generate the network's output value(s).
•Backward propagation of the propagation's output activations
through the neural network using the training pattern target in
order to generate the deltas (the difference between the targeted
and actual output values) of all output and hidden neurons.
•.
Application of AI 50
Cont..
• Phase 2: Weight update
• For each weight, the following steps must be followed:
• The weight's output delta and input activation are multiplied to find the gradient
of the weight.
• A ratio (percentage) of the weight's gradient is subtracted from the weight.
• This ratio (percentage) influences the speed and quality of learning; it is called the
learning rate.
• The greater the ratio, the faster the neuron trains, but the lower the ratio, the
more accurate the training is.
• The sign of the gradient of a weight indicates whether the error varies directly
with, or inversely to, the weight. Therefore, the weight must be updated in the
opposite direction, "descending" the gradient.
• Phases 1 and 2 are repeated until the performance of the network is satisfactory
Application of AI 51
Algorithm:
• Step 3: Calculate the weight correction term for each output unit, for unit
k it is:
Application of AI 52
Algorithm cont..
• Step 4: Propagate the delta terms (errors) back through the weights
of the hidden units where the delta input for the jth hidden unit is:
Application of AI 53
Note:
• There are a number of options in the design of a backpropagation
system;
– Initial weights – best to set the initial weights (and all other free
parameters) to random numbers inside a small range of values (say –0.5 to
0.5)
– Number of cycles – tend to be quite large for backpropation systems
– Number of neurons in the hidden layer – as few as possible
Application of AI 54
Summary of the backpropagation technique:
Application of AI 56