SlideShare a Scribd company logo
1 of 26
Download to read offline
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
机器学习AdaboostShocky1
 
Cs221 lecture5-fall11
Cs221 lecture5-fall11Cs221 lecture5-fall11
Cs221 lecture5-fall11darwinrlo
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spssDr Nisha Arora
 
Lesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdfLesson_8_DeepLearning.pdf
Lesson_8_DeepLearning.pdfssuser7f0b19
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notesUmeshJagga1
 
Learning Deep Learning
Learning Deep LearningLearning Deep Learning
Learning Deep Learningsimaokasonse
 
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-14Sri Ambati
 
Machine learning with neural networks
Machine learning with neural networksMachine learning with neural networks
Machine learning with neural networksLet's talk about IT
 
Data Mining Zoo classification
Data Mining Zoo classificationData Mining Zoo classification
Data Mining Zoo classificationMahmudul Hasan
 
Rohan's Masters presentation
Rohan's Masters presentationRohan's Masters presentation
Rohan's Masters presentationrohan_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 LibrariesJ On The Beach
 
Decision tree induction
Decision tree inductionDecision tree induction
Decision tree inductionthamizh arasi
 
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.pptxajondaree
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural NetworkDessy Amirudin
 

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
 
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
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 

More from Jun Young Park

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorchJun Young Park
 
Using Multi GPU in PyTorch
Using Multi GPU in PyTorchUsing Multi GPU in PyTorch
Using Multi GPU in PyTorchJun Young Park
 
Trial for Practical NN Using
Trial for Practical NN UsingTrial for Practical NN Using
Trial for Practical NN UsingJun Young Park
 
Convolutional Neural Network
Convolutional Neural NetworkConvolutional Neural Network
Convolutional Neural NetworkJun Young Park
 
PyTorch and Transfer Learning
PyTorch and Transfer LearningPyTorch and Transfer Learning
PyTorch and Transfer LearningJun Young Park
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural NetworksJun Young Park
 
GPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingGPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingJun 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

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

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 를 사용하는 이유와 함께 설명 하라.