SlideShare a Scribd company logo
Logistic Classifier
RTSS JUN YOUNG PARK
References – Online Lectures
• 이론 설명 참조 • Tensorflow 구현 예제 참조
References – Books
• Numpy, Matplotlib 예제 참조 • Tensorflow 구현 예제 참조
What is classification ?
◦ Classification (Marginally Prediction)
◦ Central building block of Machine Learning
Training Set
Dog Dog Dog
Cat Cat
Test Set
Dog ? Cat ?
Inputs
Labels
Quiz : Classification for Detection
◦ How can we apply classifier for detection in this case? (Quiz from Lecture)
To avoid accident while driving :
카메라에서 영상을 읽어 특정 영역에 존재하는
물체가 사람인지 아닌지를 판별한다. 이 정보를
이용하여 차량을 적절히 제어한다.
To get appropriate search result :
요청하고자 하는 문자열을 분리한 뒤 해당
문자열과 관련이 있는 웹사이트인지 판단하여
사용자에게 적절한 Response 를 보낸다.
What is Logistic Classifier ?
◦ Also called ‘Linear Classifier’
𝑊𝑊𝑋𝑋 + b = y
2.0
1.0
0.1
p = 0.7
p = 0.2
p = 0.1
S(y)
ProbabilityLogits
X : The input
W, b : To be trained ( By finding appropriate weight/bias )
y : The prediction
S(y) : Softmax function
A
B
C
Softmax Function ?
Q1 : What will be happened if multiply the value in constant ?
A1 : Getting near one or zero
Q2 : What will be happened if divide the value in constant ?
A2 : Getting near to uniform distribution
𝑆𝑆 𝑦𝑦𝑖𝑖 =
𝑒𝑒 𝑦𝑦𝑖𝑖
∑𝑖𝑖 𝑒𝑒 𝑦𝑦𝑖𝑖
from Quiz 1 : Softmax
from Quiz 2,3
‘One-Hot’ Encoding
◦ The simple way to describe the class as a numerical value!
A
0.7
0.2
0.1
Probability
1
0
0
One-Hot Encoded
A
B
C
Quiz : One-Hot Encoding
※ The zeros are omitted !
1
1 1
1
a c
Cross - Entropy
◦ The vector can be very large when there are a lot of classes.
◦ How can we find the distance between vector S(Predict) and L(Label) ?
𝐷𝐷 𝑆𝑆, 𝐿𝐿 = − �
𝑖𝑖
𝐿𝐿𝑖𝑖 log(𝑆𝑆𝑖𝑖)
0.7
0.2
0.1
1.0
0.0
0.0
S(y) L
※ D(S,L) ≠ D(L,S)
Don’t worry to take log(0)
Multinomial Logistic Classification
𝐷𝐷(𝑆𝑆 𝑊𝑊𝑋𝑋 + 𝑏𝑏 , 𝐿𝐿)
X W b S(Y)Y
0
1
0
0
0
Dog !
x
Test data (Image)
Minimizing Cross Entropy
A a あ
D(A,a) : Near D(A,あ) : Far
ℒ =
1
𝑁𝑁
�
𝑖𝑖
𝐷𝐷(𝑆𝑆 𝑤𝑤𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖)
Cross-Entropy for various training sets
Goal : Minimize it !
Approach to the optimization
◦ Gradient Descent
◦ The way to re-assign w1, w2 toward small loss.
◦ 𝑊𝑊 ← 𝑊𝑊 − 𝑎𝑎∆𝑓𝑓 𝑤𝑤𝑤, 𝑤𝑤𝑤
◦ 𝑎𝑎 : Learning rate
w1
w2
Large
Loss
Small
Loss
Initial W
Learning rate
◦ Too Large
◦ Causes ‘Overshooting’
◦ Can be deviate from the range
◦ Too Small
◦ May take too long
◦ Can stop at the Local minimum
◦ The size of the step for each learning process
Very huge step Almost fixed Local
Minimum
Normalized Input
◦ To make the problem ‘WELL CONDITIONED’
Badly Conditioned Well Conditioned
Zero Mean
Equal Variance
Standardization
𝑥𝑥𝑥𝑖𝑖 =
𝑥𝑥𝑖𝑖 − 𝜇𝜇𝑖𝑖
𝜎𝜎𝑖𝑖
𝑥𝑥 : Input
𝜇𝜇 : Mean
𝜎𝜎 : Standard Deviation
Normalized Input
800 < xy < 1828100
Overfitting
◦ How can we decrease overfitting ?
◦ More training data
◦ Reduce the number of features
◦ Regularization
◦ Large weight may bend the model.
◦ How can we ‘straighten’ the bend ?
ℒ =
1
𝑁𝑁
�
𝑖𝑖
𝐷𝐷 𝑆𝑆 𝑊𝑊𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖 + 𝜆𝜆 � 𝑊𝑊2
0 ≤ 𝜆𝜆 ≤ 1 : Regularization strength
Weight Initialization
◦ What is good initial values for W and b ?
Randomly
Generated
Weightsσ
Large σ : Distribution will have large peaks
Small σ : Distribution will be very uncertain (Better !)
Optimizing the model
ℒ =
1
𝑁𝑁
�
𝑖𝑖
𝐷𝐷(𝑆𝑆 𝑊𝑊𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖)
Normalized Input
𝑤𝑤 ← 𝑤𝑤 − 𝑎𝑎 △ 𝑤𝑤 ℒ
𝑏𝑏 ← 𝑏𝑏 − 𝑎𝑎 △𝑏𝑏 ℒ
Measuring Performance
◦ How can we measure ‘fairly’ the performance of our classifier ?
◦ Using the ‘Training set’ …
◦ Problem : It’s just cheating !
◦ Divide into Training and Test set …
◦ Problem : How can we tune our parameters without bleeding ?
◦ The simple way : Use Training, validation and Test sets !
◦ Use training and validation set for setting Learning Rate(α) and Regularization Strength(λ)
◦ Perform actual test with training and test set after tuning ‘α’ and ‘λ’
TRAINING SET
‘A’, ‘B’, ‘a’ …
Yeah ! I
got it !
Hyperparameters !
Practical Application
◦ Simple species classifier
◦ Input : Some parts of animal. [[Hair, Tail, Scale, Wing, Beak, Legs]]
◦ Output : The index for each species. {1:Mammals, 2:Reptiles, 3:Birds}
※ Actually It’s using simple neural net !
날개 + 부리 + 다리 = ?
# of features
# of classes
x_train y_train
Result
◦ The cost is being decreased for each step.
◦ Lack of training data causes low efficiency.
◦ But It classifies well !
Self Test
◦ Multinomial Logistic Classification 의 전체적인 과정을 설명하라.
◦ Normalized Input 을 사용하는 이유는 ?, 이상적인 입력은 무엇인가 ?
◦ Overfitting 이란 무엇인가 ? 왜 발생하는가 ? 어떻게 해결하는가 ?
◦ 어떤 데이터 셋에 대하여 모델을 최적화 한다는 것은 곧 어떤 의미인가 ?
◦ 성능 측정 시 트레이닝 셋만 사용할 때의 문제점과 이에 대한 개선방안을 제시하라.
◦ Overshooting 은 왜 발생하는가 ? 이를 해결 하기 위한 방법은 ?
◦ One-Hot Encoding 을 사용하는 이유를 Cross Entropy 를 사용하는 이유와 함께 설명 하라.

More Related Content

Similar to Introduction to Neural Network

Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Simplilearn
 
机器学习Adaboost
机器学习Adaboost机器学习Adaboost
机器学习Adaboost
Shocky1
 
Review : Perceptron Artificial Intelligence.pdf
Review : Perceptron Artificial Intelligence.pdfReview : Perceptron Artificial Intelligence.pdf
Review : Perceptron Artificial Intelligence.pdf
willymuhammadfauzi1
 
Cs221 lecture5-fall11
Cs221 lecture5-fall11Cs221 lecture5-fall11
Cs221 lecture5-fall11
darwinrlo
 
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Universitat Politècnica de Catalunya
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
Dr Nisha Arora
 
Lesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdfLesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdf
ssuser7f0b19
 
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof..."Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
Paris Women in Machine Learning and Data Science
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
UmeshJagga1
 
Learning Deep Learning
Learning Deep LearningLearning Deep Learning
Learning Deep Learning
simaokasonse
 
H2O Open Source Deep Learning, Arno Candel 03-20-14
H2O Open Source Deep Learning, Arno Candel 03-20-14H2O Open Source Deep Learning, Arno Candel 03-20-14
H2O Open Source Deep Learning, Arno Candel 03-20-14
Sri Ambati
 
Machine learning with neural networks
Machine learning with neural networksMachine learning with neural networks
Machine learning with neural networks
Let's talk about IT
 
Data Mining Zoo classification
Data Mining Zoo classificationData Mining Zoo classification
Data Mining Zoo classification
Mahmudul Hasan
 
Rohan's Masters presentation
Rohan's Masters presentationRohan's Masters presentation
Rohan's Masters presentation
rohan_anil
 
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво....NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
NETFest
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind Libraries
J On The Beach
 
Decision tree induction
Decision tree inductionDecision tree induction
Decision tree induction
thamizh arasi
 
Lec05.pptx
Lec05.pptxLec05.pptx
Lec05.pptx
HassanAhmad442087
 
New SPL Features in PHP 5.3 (TEK-X)
New SPL Features in PHP 5.3 (TEK-X)New SPL Features in PHP 5.3 (TEK-X)
New SPL Features in PHP 5.3 (TEK-X)
Matthew Turland
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
ajondaree
 

Similar to Introduction to Neural Network (20)

Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
Machine Learning Tutorial Part - 2 | Machine Learning Tutorial For Beginners ...
 
机器学习Adaboost
机器学习Adaboost机器学习Adaboost
机器学习Adaboost
 
Review : Perceptron Artificial Intelligence.pdf
Review : Perceptron Artificial Intelligence.pdfReview : Perceptron Artificial Intelligence.pdf
Review : Perceptron Artificial Intelligence.pdf
 
Cs221 lecture5-fall11
Cs221 lecture5-fall11Cs221 lecture5-fall11
Cs221 lecture5-fall11
 
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018Backpropagation - Elisa Sayrol - UPC Barcelona 2018
Backpropagation - Elisa Sayrol - UPC Barcelona 2018
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
 
Lesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdfLesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdf
 
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof..."Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
"Let us talk about output features! by Florence d’Alché-Buc, LTCI & Full Prof...
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
 
Learning Deep Learning
Learning Deep LearningLearning Deep Learning
Learning Deep Learning
 
H2O Open Source Deep Learning, Arno Candel 03-20-14
H2O Open Source Deep Learning, Arno Candel 03-20-14H2O Open Source Deep Learning, Arno Candel 03-20-14
H2O Open Source Deep Learning, Arno Candel 03-20-14
 
Machine learning with neural networks
Machine learning with neural networksMachine learning with neural networks
Machine learning with neural networks
 
Data Mining Zoo classification
Data Mining Zoo classificationData Mining Zoo classification
Data Mining Zoo classification
 
Rohan's Masters presentation
Rohan's Masters presentationRohan's Masters presentation
Rohan's Masters presentation
 
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво....NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
.NET Fest 2017. Игорь Кочетов. Классификация результатов тестирования произво...
 
Machine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind LibrariesMachine Learning: The Bare Math Behind Libraries
Machine Learning: The Bare Math Behind Libraries
 
Decision tree induction
Decision tree inductionDecision tree induction
Decision tree induction
 
Lec05.pptx
Lec05.pptxLec05.pptx
Lec05.pptx
 
New SPL Features in PHP 5.3 (TEK-X)
New SPL Features in PHP 5.3 (TEK-X)New SPL Features in PHP 5.3 (TEK-X)
New SPL Features in PHP 5.3 (TEK-X)
 
Lecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptxLecture 3.1_ Logistic Regression.pptx
Lecture 3.1_ Logistic Regression.pptx
 

More from Jun Young Park

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
Jun Young Park
 
Using Multi GPU in PyTorch
Using Multi GPU in PyTorchUsing Multi GPU in PyTorch
Using Multi GPU in PyTorch
Jun Young Park
 
Trial for Practical NN Using
Trial for Practical NN UsingTrial for Practical NN Using
Trial for Practical NN Using
Jun Young Park
 
Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural Network
Jun Young Park
 
PyTorch and Transfer Learning
PyTorch and Transfer LearningPyTorch and Transfer Learning
PyTorch and Transfer Learning
Jun Young Park
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
Jun Young Park
 
Deep Neural Network
Deep Neural NetworkDeep Neural Network
Deep Neural Network
Jun Young Park
 
GPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingGPU-Accelerated Parallel Computing
GPU-Accelerated Parallel Computing
Jun Young Park
 

More from Jun Young Park (8)

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
 
Using Multi GPU in PyTorch
Using Multi GPU in PyTorchUsing Multi GPU in PyTorch
Using Multi GPU in PyTorch
 
Trial for Practical NN Using
Trial for Practical NN UsingTrial for Practical NN Using
Trial for Practical NN Using
 
Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural Network
 
PyTorch and Transfer Learning
PyTorch and Transfer LearningPyTorch and Transfer Learning
PyTorch and Transfer Learning
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
 
Deep Neural Network
Deep Neural NetworkDeep Neural Network
Deep Neural Network
 
GPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingGPU-Accelerated Parallel Computing
GPU-Accelerated Parallel Computing
 

Recently uploaded

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 

Recently uploaded (20)

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 

Introduction to Neural Network

  • 2. References – Online Lectures • 이론 설명 참조 • Tensorflow 구현 예제 참조
  • 3. References – Books • Numpy, Matplotlib 예제 참조 • Tensorflow 구현 예제 참조
  • 4. What is classification ? ◦ Classification (Marginally Prediction) ◦ Central building block of Machine Learning Training Set Dog Dog Dog Cat Cat Test Set Dog ? Cat ? Inputs Labels
  • 5. Quiz : Classification for Detection ◦ How can we apply classifier for detection in this case? (Quiz from Lecture) To avoid accident while driving : 카메라에서 영상을 읽어 특정 영역에 존재하는 물체가 사람인지 아닌지를 판별한다. 이 정보를 이용하여 차량을 적절히 제어한다. To get appropriate search result : 요청하고자 하는 문자열을 분리한 뒤 해당 문자열과 관련이 있는 웹사이트인지 판단하여 사용자에게 적절한 Response 를 보낸다.
  • 6. What is Logistic Classifier ? ◦ Also called ‘Linear Classifier’ 𝑊𝑊𝑋𝑋 + b = y 2.0 1.0 0.1 p = 0.7 p = 0.2 p = 0.1 S(y) ProbabilityLogits X : The input W, b : To be trained ( By finding appropriate weight/bias ) y : The prediction S(y) : Softmax function A B C
  • 7. Softmax Function ? Q1 : What will be happened if multiply the value in constant ? A1 : Getting near one or zero Q2 : What will be happened if divide the value in constant ? A2 : Getting near to uniform distribution 𝑆𝑆 𝑦𝑦𝑖𝑖 = 𝑒𝑒 𝑦𝑦𝑖𝑖 ∑𝑖𝑖 𝑒𝑒 𝑦𝑦𝑖𝑖 from Quiz 1 : Softmax from Quiz 2,3
  • 8. ‘One-Hot’ Encoding ◦ The simple way to describe the class as a numerical value! A 0.7 0.2 0.1 Probability 1 0 0 One-Hot Encoded A B C
  • 9. Quiz : One-Hot Encoding ※ The zeros are omitted ! 1 1 1 1 a c
  • 10. Cross - Entropy ◦ The vector can be very large when there are a lot of classes. ◦ How can we find the distance between vector S(Predict) and L(Label) ? 𝐷𝐷 𝑆𝑆, 𝐿𝐿 = − � 𝑖𝑖 𝐿𝐿𝑖𝑖 log(𝑆𝑆𝑖𝑖) 0.7 0.2 0.1 1.0 0.0 0.0 S(y) L ※ D(S,L) ≠ D(L,S) Don’t worry to take log(0)
  • 11. Multinomial Logistic Classification 𝐷𝐷(𝑆𝑆 𝑊𝑊𝑋𝑋 + 𝑏𝑏 , 𝐿𝐿) X W b S(Y)Y 0 1 0 0 0 Dog ! x Test data (Image)
  • 12. Minimizing Cross Entropy A a あ D(A,a) : Near D(A,あ) : Far ℒ = 1 𝑁𝑁 � 𝑖𝑖 𝐷𝐷(𝑆𝑆 𝑤𝑤𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖) Cross-Entropy for various training sets Goal : Minimize it !
  • 13. Approach to the optimization ◦ Gradient Descent ◦ The way to re-assign w1, w2 toward small loss. ◦ 𝑊𝑊 ← 𝑊𝑊 − 𝑎𝑎∆𝑓𝑓 𝑤𝑤𝑤, 𝑤𝑤𝑤 ◦ 𝑎𝑎 : Learning rate w1 w2 Large Loss Small Loss Initial W
  • 14. Learning rate ◦ Too Large ◦ Causes ‘Overshooting’ ◦ Can be deviate from the range ◦ Too Small ◦ May take too long ◦ Can stop at the Local minimum ◦ The size of the step for each learning process Very huge step Almost fixed Local Minimum
  • 15. Normalized Input ◦ To make the problem ‘WELL CONDITIONED’ Badly Conditioned Well Conditioned Zero Mean Equal Variance Standardization 𝑥𝑥𝑥𝑖𝑖 = 𝑥𝑥𝑖𝑖 − 𝜇𝜇𝑖𝑖 𝜎𝜎𝑖𝑖 𝑥𝑥 : Input 𝜇𝜇 : Mean 𝜎𝜎 : Standard Deviation
  • 16. Normalized Input 800 < xy < 1828100
  • 17. Overfitting ◦ How can we decrease overfitting ? ◦ More training data ◦ Reduce the number of features ◦ Regularization ◦ Large weight may bend the model. ◦ How can we ‘straighten’ the bend ? ℒ = 1 𝑁𝑁 � 𝑖𝑖 𝐷𝐷 𝑆𝑆 𝑊𝑊𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖 + 𝜆𝜆 � 𝑊𝑊2 0 ≤ 𝜆𝜆 ≤ 1 : Regularization strength
  • 18. Weight Initialization ◦ What is good initial values for W and b ? Randomly Generated Weightsσ Large σ : Distribution will have large peaks Small σ : Distribution will be very uncertain (Better !)
  • 19. Optimizing the model ℒ = 1 𝑁𝑁 � 𝑖𝑖 𝐷𝐷(𝑆𝑆 𝑊𝑊𝑥𝑥𝑖𝑖 + 𝑏𝑏 , 𝐿𝐿𝑖𝑖) Normalized Input 𝑤𝑤 ← 𝑤𝑤 − 𝑎𝑎 △ 𝑤𝑤 ℒ 𝑏𝑏 ← 𝑏𝑏 − 𝑎𝑎 △𝑏𝑏 ℒ
  • 20. Measuring Performance ◦ How can we measure ‘fairly’ the performance of our classifier ? ◦ Using the ‘Training set’ … ◦ Problem : It’s just cheating ! ◦ Divide into Training and Test set … ◦ Problem : How can we tune our parameters without bleeding ? ◦ The simple way : Use Training, validation and Test sets ! ◦ Use training and validation set for setting Learning Rate(α) and Regularization Strength(λ) ◦ Perform actual test with training and test set after tuning ‘α’ and ‘λ’ TRAINING SET ‘A’, ‘B’, ‘a’ … Yeah ! I got it ! Hyperparameters !
  • 21. Practical Application ◦ Simple species classifier ◦ Input : Some parts of animal. [[Hair, Tail, Scale, Wing, Beak, Legs]] ◦ Output : The index for each species. {1:Mammals, 2:Reptiles, 3:Birds} ※ Actually It’s using simple neural net ! 날개 + 부리 + 다리 = ?
  • 22. # of features # of classes x_train y_train
  • 23.
  • 24.
  • 25. Result ◦ The cost is being decreased for each step. ◦ Lack of training data causes low efficiency. ◦ But It classifies well !
  • 26. Self Test ◦ Multinomial Logistic Classification 의 전체적인 과정을 설명하라. ◦ Normalized Input 을 사용하는 이유는 ?, 이상적인 입력은 무엇인가 ? ◦ Overfitting 이란 무엇인가 ? 왜 발생하는가 ? 어떻게 해결하는가 ? ◦ 어떤 데이터 셋에 대하여 모델을 최적화 한다는 것은 곧 어떤 의미인가 ? ◦ 성능 측정 시 트레이닝 셋만 사용할 때의 문제점과 이에 대한 개선방안을 제시하라. ◦ Overshooting 은 왜 발생하는가 ? 이를 해결 하기 위한 방법은 ? ◦ One-Hot Encoding 을 사용하는 이유를 Cross Entropy 를 사용하는 이유와 함께 설명 하라.