1 neural networks - basics artificial neural networks - basics uwe lämmel business school institute...
Post on 19-Dec-2015
234 views
TRANSCRIPT
1 Neural Networks - Basics
ArtificialNeural Networks - Basics
Uwe Lämmel
Business SchoolInstitute of
Business Informatics
www.wi.hs-wismar.de/~laemmel
2 Neural Networks - Basics
Neural Networks
• Idea
• Artificial Neuron & Network
• Supervised Learning
• Unsupervised Learning
• Data Mining – other Techniques
3 Neural Networks - Basics
Artificial Neuron & Network
• Idea• An artificial Neuron• Neural Network• Example• Learning• Application
4 Neural Networks - Basics
Idea
• A human being learns by example “learning by doing”
– seeing(Perception), Walking, Speaking,…
• Can a machine do the same?
• A human being uses his brain. A brain consists of millions of single cells.A cell is connected with ten thousands of other cell.
• Is it possible to simulate a similar structure on a computer?
5 Neural Networks - Basics
Idea
Artificial Neural Network– Information processing similar to
processes in a mammal brain– heavy parallel systems, – able to learn– great number of simple cells
? Is it useful to copy nature ? – wheel, aeroplane, ...
6 Neural Networks - Basics
Idea
• we need:– software neurons– software connections between
neurons– software learning algorithms
An artificial neural network functions in a similar way a natural neural network does.
7 Neural Networks - Basics
A biological Neuron
• Dendrits: (Input) Getting other
activations• Axon: (Output ) forward the
activation (from 1mm up to 1m long)
• Synapse: transfer of activation:– to other cells, e.g. Dendrits of
other neurons– a cell has about 1.000 to 10.000
connections to other cells• Cell Nucleus: (processing)
evaluation of activation
cell and nucleus
Axon(Neurit)
Dendrits
Synapsis
8 Neural Networks - Basics
Natural vs. Artificial Neuron
cell and nucleus
Axon(Neurit)
Dendrits
Synapsis
j
jjii ownet
),( iiacti netfact
)( iouti actfo
w1i w2i wji...
oi
9 Neural Networks - Basics
Abstraction
• Dendrits: weighted (real number) connections• Axon: output: real number• Synapse: ---
(identity: output is directly forwarded)• Cell nucleus:
unit contains simple functionsinput = (many) real numbersprocessing = activation functionoutput = real number (~activation)
10 Neural Networks - Basics
An artificial Neuron
net : input from the networkw : weight of a connectionact : activationfact : activation function
: bias/thresholdfout : output function (mostly
ID)o : output
j
jjii ownet
),( iiacti netfact
)( iouti actfo
w1i w2i wji...
oi
11 Neural Networks - Basics
Exercise: AND/OR -LTU
• Built a „network“ that works like an AND-function
• Built an OR-network• Try to built an XOR-network
LTU – Linear Threshold Unit
12 Neural Networks - Basics
A simple switch
• Neuron = AND-function• Find parameters:
– Input neurons 1,2 : a1,a2 input pattern,
– weights of edges: w1, w2
– bias • Now evaluate output o !
a1=__ a2=__
o=__
net = o1w1+o2
w2a = 1, if net >= 0, otherwise
o = a
w1=__ w2=__
13 Neural Networks - Basics
Mathematics in a Cell
• Propagation function (neuron input) neti(t) = ojwj = w1i o1 + w2i o2 + ...
• Activationai(t) – Activation at time t
• Activation function fact :ai(t+1) = fact(ai(t), neti(t), i)
i – bias
• Output function fout :
oi = fout(ai)
14 Neural Networks - Basics
Activation
rea l
u n re str icted
[0 ,1 ][-1 ,+ 1 ]
In te rva l
co n tin uo us
0 ,1-1 ,+ 1
- ,+
b in ary
{ -1 ,0 ,+ 1}{ -10 0 ,... ,+ 10 0}
m u lti v a lue
d iscre te
A c tiv a tion
15 Neural Networks - Basics
Bias function
-1,0
-0,5
0,0
0,5
1,0
-4,0 -2,0 0,0 2,0 4,0
Identity
-4,0
-2,0
0,0
2,0
4,0
-4,0 -2,5 -1,0 0,5 2,0 3,5
Activation Functions activation functions
aresigmoid functions
16 Neural Networks - Basics
y = tanh(c·x)
-1,0
-0,5
0,5
1,0
-0,6 0,6 1,0
c=1c=2
c=3
-1,0
Activation Functions
y = 1/(1+exp(-c·x))
0,5
1,0
-1,0 0,0 1,0
c=1c=3
c=10
Logistic function:
activation functions
aresigmoid functions
17 Neural Networks - Basics
Structure of a network
• layers– input layer – input neurons– output layer – output neurons– hidden layer – hidden neurons
• An n-layer network has:– n layer of connections which can be
trained
18 Neural Networks - Basics
Definition: A Neural Network …
• … is characterized by – connections of many (a lot of) simple units
(neurons) and– units exchanging signals via these
connections
• … is a – coherent, directed graph which has– weighted edges and– each node (neuron, unit )
contains a value (activation).
19 Neural Networks - Basics
XOR-network
• weights are set by hand
• fact = 1, net > = 0, otherwise
= 1.0
input
output
weight matrix wij: i\j 1 2 3 4 1 0 0 1 1.2 2 0 0 1 1.2 3 0 0 0 -2 4 0 0 0 0
20 Neural Networks - Basics
XOR-Example
• standard propagation function: neti(t) = oj(t)wji
• activation function = bias function– ai = 1, if neti(t)> i e.g. =0.5
0, otherwise– output function = Identity: oj = aj
• use EXCEL and built the XOR-example network!
21 Neural Networks - Basics
Learning
Network
changing network parameters
evaluation network errorlearning
examples
22 Neural Networks - Basics
Learning - can be done by:
1. Modification of the weight of a connection – most frequently used
2. Deleting connections– can be done by (1): w=0 w0
3. Modification of the bias of a neuron– Can be done by (1) using an extra neuron
4. changing functions (activation, propagation, output function)
5. Building new cells (GNG)6. Building new connections7. Deleting cells
23 Neural Networks - Basics
Learning
• supervised learning– We know the results for certain input pattern:
teaching input teaching output
– Network error is used to adapt weights– Fast, but not natural
• reinforced learning– We know whether output is right or wrong– Information is used to adapt weights – Slower than supervised; natural
• unsupervised learning– Network has to learn by itself;– Slow , natural
24 Neural Networks - Basics
Applications
Pattern recognition (text, numbers, faces)
Checking the quality of a surface Control of autonomous vehicles Monitoring of credit card accounts Data Mining
25 Neural Networks - Basics
Applications
Speech recognition Control of artificial limbs classification of galaxies Product orders (Supermarket) Forecast of energy
consumption Stock value forecast