Introduction to Neural Networks
PHYS591000 2023.03.23
Outline
2
Warming up
3
Neural Network
4
Source: Wikipedia
How does a neuron work?
5
X1 * W1
X2 * W2
+ b
W1, W2: weights
b: bias
How does a neuron work?
6
Activation Function
7
‘Off’
‘On’
Courtesy of Prof. Kai-Feng Chen (NTU)
Activation Function
8
Sigmoid
Network Architecture
9
Courtesy of Prof. Kai-Feng Chen (NTU)
Network Architecture
10
Review: Goal of training a model
11
y (Energy)
x (Number of shower particles)
y = h(x) = θ0 + θ1 x
θ0 , θ1 : parameters
Intercept θ0
Slope θ1
Review: Goal of training a model
12
y (Energy)
x (Number of shower particles)
y = h(x) = θ0 + θ1 x
θ0 , θ1 : parameters
Intercept θ0
Slope θ1
How to Train Neural Network
13
Number of data points
Current output given input x
True value y for input x
How to Train Neural Network
14
How to minimize the loss function
15
Gradient of Loss (average over the input data)
a tunable hyperparameter
Courtesy of Prof. Kai-Feng Chen (NTU)
Optimizer/Solver for minimizing loss function
The method is called stochastic gradient descent (SGD).
16
Gradient of Loss approximated by average over a subset of input data
Optimizer choice
17
Training Process hyperparameters
18
Neural Network Parameters
19
Choice of Loss Function
20
Courtesy of Prof. Kai-Feng Chen (NTU)
Choice of Loss Function
21
Courtesy of Prof. Kai-Feng Chen (NTU)
Choice of Loss Function and Output Layer
22
Courtesy of Prof. Kai-Feng Chen (NTU)
Choice of Loss Function and Output Layer
23
Regularization
24
Number of epochs
In-class exercise
25
In-class exercise
26
Lab for this week
27
Backup
28
Neural Network Information Flow
29
Source: Wikipedia
Flow of information