Presentation is loading. Please wait.

Presentation is loading. Please wait.

Machine Learning to Deep Learning

Similar presentations


Presentation on theme: "Machine Learning to Deep Learning"— Presentation transcript:

1 Machine Learning to Deep Learning
Tutorial code: Jemin Lee Hompage: 역사 알고리즘 약간은 깊이 있는 이해 그것을 통한 실제 구현 과 응용 시스템 Area에서의 Deep-Learning

2 국내, PyCon 2016, TensorFlow kr 2차
머신러닝 / 딥러닝 공부 코스 (2015.3~) Coursera 머신러닝(초급), Octave Udacity 딥러닝(초급), TensorFlow Coursera, 실전 머신러닝(초급), R 김성훈 교수, TensorFlow(초급) Stanford, Fei-Fei-Li, CNN 딥러닝(중급) Bay Area DL School (고급,경향 분석) 국내, PyCon 2016, TensorFlow kr 2차 실제 프로젝트 개발경험 공유 (고급)

3 머신 러닝 (Machine Learning)

4 머신러닝이란 “머신 러닝 또는 기계 학습은 인공 지능의 한 분야로, 컴퓨터가 학습할 수 있도록 하는 알고리즘과 기술을 개발하는 분야를 말한다.” - 위키피디아 “Field of study that gives computers the ability to learn without being explicitly programmed.” - Arthur Samuel, 1959 데이터 마이닝은 지식이나 인사이트를 얻는다. 머신러닝은 새로운 데이터를 처리하는 데 촛점을 맞추므로 어떻게 해결되었는 지 적절하게 설명하기 어려울 수 있다. 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

5 리소스 분류 Statistics Computer Science Data Mining Statistical ML 확률 인공지능
회귀 뉴럴 네트워크 베이지안 네트워크 Machine Learning 컴퓨터 비전 자연어처리 통계학의 알고리즘에 많이 의존함. 통계학적 머신러닝이라고 부르기도 함. 컴퓨터 과학에 좀 더 실용적 접근이 많음. 추천 패턴인식 연관분석 빅데이터 Data Mining 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

6 𝐀𝐈⊃𝐌𝐚𝐜𝐡𝐢𝐧𝐞 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠⊃𝐃𝐞𝐞𝐩 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠
AI는 언어학, 뇌의학, 검색, 로봇틱스 포함 아직 일반지능이 아님 딥러닝은 뉴럴 네트워크를 사용한 머신러닝 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

7 시간에 따른 변화 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나
2012년 제프리힌튼 팀의 이미지 분류 논문(ImageNet Classification with Deep Convolutional Neural Networks) 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

8

9 머신러닝 분류

10 학습 방법 지도학습, 감독학습 비지도학습, 비감독학습 강화학습 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나
훈련데이터/학습데이터 지도학습: 주가예측, 스팸메일 분류 비지도학습: 고객 분류 딥 러닝은 알고리즘의 하나로 학습방법이 아님. 딥 리인포스먼트 러닝 비지도학습, 비감독학습 강화학습 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

11

12 Table of Contents Fundamental Machine Learning (1일차)
Linear Regression: Gradient Descent Algorithm (optimization) Logistic Regression (Single Neuron=Perceptron): Sigmoid (Logistic function), Convexity, Cross Entropy, Decision Boundary Multiple Perceptron (Hidden Layer): Backpropagation algorithm Deep Neural Network Breakthrough (2-3일차) Rebirth of Neural Network, renamed DNN TensorFlow Basic DNN, ReLU, Pre-training, Dropout Convolutional Neural Network (CNN) How to apply DNN into real world problem (4일차) Use-case: smarttention 2016

13 Linear Regression: 이론 Gradient Descent

14 Which hypothesis is better
출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

15 Cost function[1/2] How fit the line to our (training) data
비용 함수 (Cost Function) == 손실 함수 (Loss Function) == 목적 함수 (Objective Function) == 오차 함수 (Error Function) 𝐻 𝑥 −𝑦 평균 제곱 오차(Mean Square Error)* 오차의 제곱 미분후 깔끔을 위해 2로 나눔 모든 훈련 데이터의 오차 제곱을 더함 훈련 데이터 갯수로 나눔

16 Cost function[2/2] 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

17 Goal: Minimize cost 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

18 Gradient Descent Algorithm
출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

19 Gradient Descent Algorithm
Minimize cost function For a given cost function, Cost(W,b), it will find W,b to minimize cost It can be applied to more general function: cost(w1, w2,…) Where you start can determine which minimum you end up Perfect convexity 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

20 Formal definition 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

21 Gradient Descent Intuition[1/2]
Coursera, Machine Learning, Andrew Ng

22 Gradient Descent Intuition[2/2]
Coursera, Machine Learning, Andrew Ng

23 Linear Regression: 실습

24 실습 IDE: Jupyter Notebook

25 실습 라이브러리 IPython 3.5.2 환경 IDE: Jupyter Notebook (version 4.3.1)
NumPy: 수치 배열 연산 Scipy: 과학 공학 계산 툴박스 (partial derivative) Matplotlib: 그래프 (Matlab 스타일) Sympy: 심볼릭 연산 (미적분) Pandas: 통계 처리 (R과 같은 통계처리 DataFrame 자료구조 지원)

26 실습 서버 접속 크롬 웹 브라우저 주소창에: 168.188.xxx.xxx:8888 비밀번호: Wi-Fi 공유기와 같음
각자 실습할 디렉터리 위치: ~/ESLAB_ML/본인영어이름/ 실습 예제 코드 l_Neural_Network/ex1/ex1_jemin.ipynb

27

28 Linear Regression with One Variable
Suppose you are the CEO of restaurant franchise and are considering different cities for opening a new branch. You'd like to use this data to help you select which city to expand to next. The file ex1data1.txt contains the dataset for our linear regression problem. The first column is the population of a city and the second column is the profit of a food truck in that city. A negative value for profit indicates loss. Coursera, Machine Learning, Andrew Ng

29 (Single Neuron, Perceptron, Logistic Regression)
하나의 뉴런 (Single Neuron, Perceptron, Logistic Regression)

30 Perceptron(2/2)

31 Perceptron(2/2) 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

32 Decision Boundary

33 왜 비선형 함수 Sigmoid이 필요한가? 𝑦 = 𝑤 2 × 𝑡+ 𝑏 2 = w 2 × 𝑤 1 × 𝑥+ 𝑏 1 + 𝑏 2
𝑦 = 𝑤 2 × 𝑡+ 𝑏 2 = w 2 × 𝑤 1 × 𝑥+ 𝑏 1 + 𝑏 2 = 𝑤 2 × 𝑤 1 × 𝑥+ 𝑏 1 + 𝑏 2 =𝑤 × 𝑥+𝑏 𝑦 = 𝑤 2 × 𝝋 𝑡 + 𝑏 2 미분가능한 비선형함수: 시그모이드(Sigmoid), 렐루(ReLU), 하이퍼볼릭탄젠트(tanh) 출처: 해커에게 전해들은 머신러닝, 한빛미디어 리얼타임 세미나

34 Cost Function: Cross Entropy[1/2]

35 Cost Function: Cross Entropy[2/2]
Coursera, Machine Learning, Andrew Ng

36 Cross Entropy and Gradient Descent
Cost Function 합치기 𝐶𝑜𝑠𝑡=− 1 𝑚 𝑖=1 𝑚 [𝑦𝑙𝑜𝑔 𝑦 + 1−𝑦 log⁡(1− 𝑦 )] Gradient Descent Logistic Cost Function 미분 = 선형 회귀 비용함수 미분과 동일 𝜕𝐶𝑜𝑠𝑡 𝜕𝑤 =− 1 𝑚 𝑖=1 𝑚 𝑦− 𝑦 𝑥 Coursera, Machine Learning, Andrew Ng

37 하나의 뉴런: 실습

38 해결하고자 하는 문제 학생들이 대학에 입학 할 수 있는지를 예측 과거 지원자의 두 과목 시험 점수와 결과
Ex: 100, 99 = 합격(1) 50, 70 = 불합격(0) 코드 위치 rk/ex2/ex2_jemin.ipynb Coursera, Machine Learning, Andrew Ng

39 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

40 Multi-layer Neural Network Multi-layer Perceptron: 이론
Backpropagation

41 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

42 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

43 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

44 First Dark Age (1969~1986, 17) 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

45

46 Neural-Network: 두 번째 봄 (Second Spring)

47 Neural Network Presentation[1/2]
Layer 1 has 2 input nodes and Layer 2 has 4 activation nodes Dimension of 𝜃 (1) is going to be 4x3 𝑠 𝑗 =2 𝑠 𝑗+1 =4 𝑠 𝑗+1 × (𝑠 𝑗 +1)=4×3 Coursera, Machine Learning, Andrew Ng

48 Neural Network Presentation[2/2]

49 Coursera, Machine Learning, Andrew Ng

50 New Cost function Coursera, Machine Learning, Andrew Ng

51 Backpropagation: gradient computation
Coursera, Machine Learning, Andrew Ng

52 Backpropagation: gradient computation
Coursera, Machine Learning, Andrew Ng

53 Coursera, Machine Learning, Andrew Ng

54 Backpropagation: Delta 유도
본인 블로그:

55 Sigmoid Gradient Sigmoid의 derivative 방법은 아래와 같다.

56 딥러닝 6. Fully Connected Neural Network, 홍정모 교수님

57 딥러닝 6. Fully Connected Neural Network, 홍정모 교수님

58 딥러닝 6. Fully Connected Neural Network, 홍정모 교수님

59 동국대 홍정모 교수님, http://blog.naver.com/atelierjpro/220773276384

60 Backpropagation Intuition
Neural Net.은 non-convex optimization 실증 적으로 큰 문제 없다. Local minimum을 찾더라도 꽤 괜찮은 local minimum 을 찾는다. Global Optimal value를 찾는 것은 불가능 보통 gradient descent 방법을 이용해서 적당한 값 까지 수렴하는 전략을 취한 다. Gradient를 chain rule을 사용해서 단순화 시킨 것 지나지 않는다.

61 Backpropagation 구현 알고리즘
Coursera, Machine Learning, Andrew Ng

62 Coursera, Machine Learning, Andrew Ng

63 Coursera, Machine Learning, Andrew Ng

64 Coursera, Machine Learning, Andrew Ng

65 Numerical estimation of gradients
Coursera, Machine Learning, Andrew Ng

66 Coursera, Machine Learning, Andrew Ng

67 Multi-layer Perceptron: 실습
Backpropagation

68 MNIST Database Digit number data 학습 데이터 60,000 테스팅 데이터 10,000
Deep Learning, Top-guru, Yann LeCun, 뉴욕대 교수 학습 데이터 60,000 테스팅 데이터 10,000 전처리 완료 데이터 (size, label, color) 코드 위치 rk/ex4/ex4_jemin.ipynb

69 Facebook AI Research (FAIR)

70

71 Neural Network Model Three layer Neural Net. Input layer= 20x20+1
Hidden layer= 25 Output layer= 10

72 Go deeper: Deep Neural Network
a.k.a Deep Learning

73 A BIG problem Backpropagation just did not work well for normal neural networks with many layers Other rising machine Learning algorithms: SVM, Radom-Forest, EM, etc. Statistical method Chou-Fasman method ~ 50% Nearest neighbors ~50~60% Neural networks ~75% (Breakthrough!), 1986 (Dark age for 20 years) Support Vector Machine (SVM) ~ 75% HMM ~ 75% Random Forest ~75% Deep Learning ~88%, 2006 (rebirth of neural net. with big data).

74 Rebirth of Neural Network: Third Spring
포기하지 않는 연구: 20년간의 겨울 ( ) 인공지능과 딥러닝 빅데이터 안고 부활

75 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

76 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

77 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

78 출처: 모두를 위한 머신러닝 시즌1, 김성훈 교수님

79 NIPS Reject Ruslan Salakhutdinov’s (with Geoffrey Hinton) method for Netflix competition was rejected by NIPS 2006 with a hardcore-reviewer comment: “it's junk and I am very confident it's really junk” His paper is accepted later by ICML2007 (Restricted Boltzmann machines for collaborative filtering), and this method was one of the important methods the champion team blended into their algorithm. NIPS_Reject was also known as the author of the Science paper about Deep Autoencoder. – There was a rumor that this paper is also rejected by NIPS, but it is not confirmed. For a long while, the selected papers in Ruslan’s homepage were the Science paper and the AI&Statistics paper about learning Deep Boltzmann Machines. They were not NIPS papers.

80 Deep Learning의 혁신[1/4]: Google Intern
Phonemes: 어떤 언어에서 의미 구별 기능을 갖는 음성상의 최소 단위

81 Deep Learning의 혁신[2/4]: Competition 우승

82 Deep Learning의 혁신[3/4]

83 Deep Learning의 혁신[4/4] ImageNet Classification
Top-rank: Krizhevsky and hinton et al.(convent) 16.4% error (top-5) Second-rank: Next best (non-convent) 26.2% error

84

85

86 문제점과 해결점 Algorithm적 문제 Training Data의 부족 Computing Power 문제 Solution
Vanishing Gradient -> ReLU (new activation function) Local minimum problem -> pre-training, Restricted-Boltzmann-Machine(RBM) Overfitting -> Dropout, Big-Data Training Data의 부족 Smartphone IoT Computing Power 문제 GPGPU, NVIDA Cloud Computing, AWS, Azure

87

88 Algorithm: Vanishing Gradient
Sigmoid의 도함수 𝑧=𝑤𝑥+𝑏 𝑔 ′ 𝑧 =𝑔 𝑧 1−𝑔 𝑧 𝑔 𝑧 = 1 1+exp⁡(−𝑧) 0.25 Local Gradient의 Maximum이 0.25 Layer 1개를 지날 때마다 magnitude는 항상 one quarter 이하로 작아진다. Yes you should understand backprop, Andrej Karpathy

89 Algorithm: Rectified linear Unit (ReLU)
𝑓 𝑥 = 0, 𝑰𝒇 𝑥<0 𝑥, 𝑰𝒇 𝑥 ≥0 도함수 𝑓 𝑥 = 0, 𝑰𝒇 𝑥<0 1, 𝑰𝒇 𝑥 ≥0 ReLU Sigmoid Yes you should understand backprop, Andrej Karpathy

90 Algorithm: Restricted-Boltzmann-Machine(RBM)
즉, 이 모델은 RBM을 맨 아래 data layer부터 차근차근 stack으로 쌓아 가면서 전체 parameter를 update하는 모델이다. 이 모델을 그림으로 표현하면 아래와 같은 그림이 된다. Restricted Boltzmann Machines - Ep. 6 (Deep Learning SIMPLIFIED)

91 Algorithm: Pre-training
No need to use complicated RBM for weight initializations Simple methods are fine Xavier initialization [1] [1] Understanding the difficulty of training deep feedforward neural networks, 210

92 Algorithm: Overfitting[1/2]
Dropout It is an extremely effective, simple and recently introduced regularization technique by Srivastava et al [1]. While training, dropout is implemented by only keeping a neuron active with some probability p (a hyper-parameter), or setting it to zero otherwise. [1] Journal of Machine Learning Research, Dropout: A Simple Way to Prevent Neural Networks from Overfitting

93 Algorithm: Overfitting[2/2]
BigData Real Word == Collected Data 데이터가 많다면 Overfitting을 하는 경향은 최대의 장점이 된다.

94 Deep Learning의 혁신

95 NIPS 3755 attendees at NIPS2015! 1838 paper submissions, reviewers producing 10,625 reviews resulting in 403 papers (21.9%). Only 20 oral talks are selected among 403 accepted papers (single- track). 7pm-12am (5hr) poster session every day.

96 Deep Learning’s Pioneers
Google Scholar 피인용 지수: Yann LeCun 44K, Geoffrey Hinton 160K, Yoshua Bengio 56K, Andrew Ng 72K David E. Culler 84K

97 TensorFlow playground

98 감사합니다.


Download ppt "Machine Learning to Deep Learning"

Similar presentations


Ads by Google