Lecture 1 - Introduction To NN - CET
Lecture 1 - Introduction To NN - CET
Image
Recognition
(DL)
Lecture 1:
Introduction to
Neural Network
Topics
1.Artificial Intelligence, Machine Learning and
Deep Learning
1. AI, ML and DL
Official (Closed) - Non Sensitive
Personal
• Symbolic AI Computer
1950 (1960s)
s- • (classical programming)
1980
s Internet
(1990s)
• Machine Learning
1990 • (Neural Network,
Social Media
s- Decision Tree) (post 2004)
now
Classic
Programming
Answer
Official (Closed) - Non Sensitive
Machine
Learning
Rules /
Model
Official (Closed) - Non Sensitive
network
• Layers: combined into a
model Hidden layers
• Input Data and (containing
neurons/nodes)
corresponding targets /
labels
• Optimizer: determines
how learning proceeds
Predicted Actual
Output Output
Official (Closed) - Non Sensitive
Loss Score
Education = Y- Y’
=0.4671
Forward Propagation
Official (Closed) - Non Sensitive
=-0.2 =ReLU(-0.33)=0.0
=0.5*0.1+0.3*0.2+0.2*0.3+(-0.5)=-0.33
=0.5*0.6+0.3*0.4+0.2*0.8+(-0.2)=0.48 =ReLU(0.48)=0.48
=0.0*0.7+0.48*0.9+(-0.3)=0.132
=Sigmoid()=0.53295
Official (Closed) - Non Sensitive
Age 0.2
Loan approve = 1
0.3 Loan reject = 0
0.8 Prediction True Target
0.4 Y’ Y
-0.4
Salary 0.6177 1.0
0.7 1.0
0.5
-0.2 Loss Score Lower loss means the
= Y - Y’ increase in weight is
Education 0.9
=0.3823 effective
0.0
Backpropagation
Assuming all weights are
learned to increase by 0.1
Official (Closed) - Non Sensitive
• Backpropagation
• Computation of the gradient values of a neural network
Official (Closed) - Non Sensitive
• Functional API
• Can build arbitrary architectures
Official (Closed) - Non Sensitive
Input Data
Compile
Training
Evaluate
Official (Closed) - Non Sensitive
• Label
• 0: negative
• 1: positive
Official (Closed) - Non Sensitive
Practical 1a Demo
Official (Closed) - Non Sensitive
Using movie reviews data from IMDB dataset, you will train a neural
network model to predict if a new movie review is positive or negative.
Official (Closed) - Non Sensitive
4.4 Wrapping Up
• Preprocessing Raw data to become tensors, feeding into neural
network
• Stacks of Dense layers with ReLU activations can solve a wide range
of problems
• In a binary classification problem, the model should end with a
Sigmoid unit to output a probability
• The RMSprop optimizer is a good enough choice
• Neural networks eventually start overfitting on the training data so
always monitor performance on data outside of training set.
Official (Closed) - Non Sensitive
5.1 Dataset
• A total of 506 samples (404 training & 102 testing)
• Each Sample has:
• Input Data (13 features): crime rate, residential proportion,
distances to centers, pupil-teacher ratio, accessibility to highways
and etc.
• Target: the median price of home in this area
5.3 Wrapping Up
• Regression is done using different loss function, e.g. Mean
Squared Error (MSE)
• Evaluation metrics, Mean Absolute Error (MAE), is most
commonly used for regression tasks
• When input features have values in different ranges, we
should normalize the data
Official (Closed) - Non Sensitive
Q&A
Official (Closed) - Non Sensitive
References
Books:
Online Resources:
https://en.wikipedia.org/wiki/Artificial_neural_network