Day1 05 Introduction To DeepLearning Part
Day1 05 Introduction To DeepLearning Part
Table of contents
Modeling a neuron Artificial neuron: Perceptron
Artificial neuron: activation functions
Perceptron
Artificial neural network: ANN
How perceptron classifies hyperplane
Fully connected feed-forward network: FC-FFN
Perceptron: Boolean Optional output layer: Softmax
Perceptron: Boolean AND training How to find a good or the best network: Loss/Cost
Multi-layered perceptron How to find a good or the best network: Total Lost
How to minimize total loss by changing [W] and [b]
Layer-wise organization
Optimization algorithm: gradient descent
Categories of ANN
How to compute gradient
Brief history of neural network Neural network
Popular frameworks Popular types of neural network
Deep neural net
NN categories by applications
1
1/19/2025
Modeling a neuron
Neuron: 신경세포(神經細胞)
► Dendrite: 수상돌기(樹狀突起)
input
► Axon: 축삭돌기(軸索突起)
output
Branches of axon
Terminals of axon (axon tip)
⚫ synaptic knob
► Synapse: 연접
junction between two nerve cells
Human
► whole brain
~86 billion neurons (Giga, 109)
~100 trillion synapses (Tera, 1012)
► cerebral cortex: 대뇌피질
19~23 billion neurons
https://www.quora.com/What-is-deep-learning
Copyright (c) by Ando Ki 3
Modeling a neuron
https://en.wikipedia.org/wiki/Activation_function
Activation functions
sigmoid
sigmoid
2
1/19/2025
X1 W1 X2
t Y Y=b
X2 W2
Y=a
X1
W1*x1+W2*x2 + W0 = 0
➔ y = ax + b
X1 W1 X3
X2 W2 t Y
X3 W3
X2
X1
Need multi-layer perceptron
W1*x1+W2*x2 + W3*x3 + W0 = 0
➔ z = ax + by + c
Copyright (c) by Ando Ki 6
3
1/19/2025
Perceptron: Boolean
t=1.5 Y t=0.5 Y
X1 W1=-1 t=-0.5 Y t=1.5 Y
1 1 Y=1 Y=0
1 Y=0 Y=1 1 Y=1 Y=1
0 X1 0 X1
0 X1 0 X1
0 1 0 1
0 1 0 1
4
1/19/2025
10
5
1/19/2025
Multi-layered perceptron
Two-unit network (two layers)
X1 H3
O6 Y
X2 w24 H4
XOR
X2
1 Y=1 Y=0
0 X1
0 1
11
Layer-wise organization
3 types of layers input layer: not counted for the number of
layers
► Input layer
hidden layer
► hidden layer
output layer
► output layer
12
6
1/19/2025
13
Popular Frameworks
Popular Frameworks with supported
interfaces
► Caffe
Berkeley / BVLC (Berkeley Artificial Intelligence
Research)
C, C++, Python, Matlab
► TensorFlow
Google Brain
C++, Python
► PyTorch
► theano
U. Montreal
Python
► torch
Facebook / NUU
C, C++, Lua
► CNTK https://blogs.nvidia.com/blog/2016/01/12/accelerating-ai-artificial-intelligence-gpus/
Microsoft
► MXNet
Carnegie Mellon University / DMLC (Distributed
Machine Learning Community)
https://developer.nvidia.com/deep-learning-frameworks
Copyright (c) by Ando Ki 14
14
7
1/19/2025
Popularity
Deep Learning Framework Deep Learning Framework Power Scores (by Jeff Hale) http://bit.ly/2GBa3tU
https://towardsdatascience.com/deep-learning-framework-power-scores-2018-23607ddf297a
Copyright (c) by Ando Ki 15
15
Table of contents
Artificial neuron: Perceptron Neural network
Artificial neuron: activation functions Popular types of neural network
Artificial neural network: ANN Deep neural net
Fully connected feed-forward network: FC- NN categories by applications
FFN
Optional output layer: Softmax Popular DNNs and Frameworks
How to find a good or the best network:
Loss/Cost
How to find a good or the best network:
Total Lost
How to minimize total loss by changing [W]
and [b]
Optimization algorithm: gradient descent
How to compute gradient
16
8
1/19/2025
17
y=max(x,0)
18
9
1/19/2025
Neuron
19
2 2 2
A B M
20
10
1/19/2025
1 0 -2
0 0 2
1, -1
[1, -1] x + [1, 0] = [4, -2] sigmoid [0.98, 0.12]
-2, 1
x1 x2 y1 y2
[0.98, 0.12] x
2, -2
+ [0, 0] =[1.84, -2.08] sigmoid [0.86, 0.11] f ([1, -1]) = [0.62, -0.83]
-1, -1
f ([0, 0]) = [051, 0.85]
3, -1
[0.86, 0.11] x + [-2, 2] = [ ??, ??] sigmoid [ ??, ??]
-1, 4
21
Do it yourself
Calculate the output
1 0 -2
0 (1) (-1)
0 0 2
22
11
1/19/2025
23
x2 (1) (-1) ez
z2
0 0 2
24
12
1/19/2025
25
Softmax x1 0:0.02
x2 1:0.9
Input values
argmax 1
input xn 9:0.01
(index:out_value)
26
13
1/19/2025
Output values
Target values
x2 y2 Indicates cat t2=1
Input values Network
Parameter
input
(16x16 pixels) x256 y10 Indicates truck t10=0
27
y1 t1 l1
total loss = sum of all loss
For all training data
y2 t2 l2
yR tR lR
28
14
1/19/2025
error
Squared error loss
► Sum of squared errors
sum((t - y)**2)
► Mean squared errors (MSE)
sum((t-y)**2)/n
► Root mean square errors (RMSE) t-y
(MSE)**(1/2)
y
Cross-entropy loss t y
► For classification after Softmax 1 1
29
Log plots
import numpy as np
from matplotlib import pyplot as plt
plt.grid()
plt.show()
30
15
1/19/2025
<0
>0
W W
Wt=0 Wt=1 Wt=1 Wt=0
Wt=0 - Wt=0 -
► Negative slope ➔ increase W by some function of learning rate
► Positive slope ➔ decrease W
► Steep slope ➔ large change of W for the next time
► go on until the slope is small enough, i.e., inflection point
31
32
16
1/19/2025
33
깊고 가늘다(얇다)
34
17
1/19/2025
35
36
18
1/19/2025
37
38
19
1/19/2025
39
20