Neural Networks
Neural Networks
Neural Networks
example)
Neural networks to the rescue
Neural networks are configured for a specific
application, such as pattern recognition or data
classification, through a learning process
In a biological system, learning involves
Hebb’s Rule:
If an input of a neuron is repeatedly and persistently
causing the neuron to fire, a metabolic change
happens in the synapse of that particular input to
reduce its resistance
Mathematical representation
The neuron calculates a weighted sum of inputs and compares it
to a threshold. If the sum is higher than the threshold, the
output is set to 1, otherwise to -1.
Non-linearity
A simple perceptron
It’s a single-unit network
Change the weight by an
amount proportional to the
difference between the desired
output and the actual output.
Δ Wi = η * (D-Y).Ii Input
Actual output
Learning rate
Desired output
Fast evaluation
interpret
When to consider neural networks
Input is high-dimensional discrete or raw-valued
Output is discrete or real-valued
Output is a vector of values
Possibly noisy data
Form of target function is unknown
Human readability of the result is not important
Examples:
Speech phoneme recognition
Image classification
Financial prediction
A Neuron (= a perceptron)
- t
x0 w0
x1 w1
f
output y
xn wn
For Example
n
Input weight weighted Activation y sign( wi xi t )
vector x vector w sum function i 0
Parts
N inputs, x1 ... xn
Weights for each input, w1 ... wn
A bias input x0 (constant) and associated weight w0
Weighted sum of inputs, y = w0x0 + w1x1 + ... + wnxn
A threshold function or activation function,
i.e 1 if y > t, -1 if y <= t
Artificial Neural Networks (ANN)
Model is an assembly of Input
nodes
inter-connected nodes Black box
Output
and weighted links X1 w1 node
w2
X2 Y
Output node sums up w3
output units
Feedforward networks
These compute a series of
transformations hidden units
Typically, the first layer is the
input and the last layer is the
input units
output.
Recurrent networks
These have directed cycles in their
connection graph. They can have
complicated dynamics.
More biologically realistic.
Different Network Topologies
Single layer feed-forward networks
Input layer projecting into the output layer
Single layer
network
Input Output
layer layer
Different Network Topologies
Multi-layer feed-forward networks
One or more hidden layers. Input projects only
from previous layers onto a layer.
2-layer or
1-hidden layer
fully connected
network
Input Hidden Output
layer layer layer
Different Network Topologies
Multi-layer feed-forward networks
Recurrent
network
Input Output
layer layer
Algorithm for learning ANN
Initialize the weights (w0, w1, …, wk)
Y I ( 0 .3 X 1 0 .3 X 2 0 .3 X 3 0 .4 0 )
1 if z is true
where I ( z )
0 otherwise
General Structure of ANN
x1 x2 x3 x4 x5
Input
Layer Input Neuron i Output
I1 wi1
wi2 Activation
I2
wi3
Si function Oi Oi
Hidden g(Si )
Layer I3
threshold, t