Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[CS Foundation] AIML - 1 - introduction

[CS Foundation] AIML - 1 - introduction

x-village

August 14, 2018
Tweet

More Decks by x-village

Other Decks in Programming

Transcript

  1. Outline • Introduction to AI & Machine Learning • Machine

    Learning Framework • Types of Machine Learning ◦ Supervised Learning ◦ Unsupervised Learning ◦ Reinforcement Learning • Machine Learning Workflow ◦ Data Preprocessing ◦ Train & Testing Data ◦ Evaluation 2
  2. Input layer hidden layer output layer 5 Second progress (1980-1987)

    • Artificial Neural Network • Expert System
  3. AlexNet (2012) 8 layers 16.4% 16-19 layers VGGNet-16 (2014) 7.3%

    22 layers GoogleNet-16 (2014) 6.7% 6 Third progress (2012 ~ )
  4. 8

  5. What makes AI success in this era? • Breakthrough in

    computing - GPU 11 GPU consists of more ALU than CPU in a chip. video: https://www.youtube.com/watch?v=-P28LKWTzrI
  6. Why do we need machine learning? 13 先試想以下問題: 1. 我們要怎麼判斷一封電子郵件是垃圾郵件還是重要郵件?

    2. 我們要推薦什麼樣的商品給我們的顧客? 3. 我們可以用先前學到的資料結構、演算法處理這樣的問題嗎? - Weakness of hand-crafted rules - hard to consider all possibilities - Data-driven approach - Machine Learning
  7. What is Machine Learning Learning It is a cat! 14

    cat dog bird Write a program for learning.
  8. Machine Learning 15 Learning = Looking for a function from

    data • Image Recognition • Speech Recognition • Play Games
  9. Framework Hypothesis Function Set Model 16 h 1 ( )

    = “cat” h 1 ( ) = “dog” h 2 ( ) = “cat” h 2 ( ) = “bird”
  10. Training Data Hypothesis Function Set Model Goodness of function Framework

    17 h 1 ( ) = “cat” h 1 ( ) = “dog” h 2 ( ) = “cat” h 2 ( ) = “bird” f( ) = “cat” f( ) = “dog” f( ) = “bird” Target Function, f : X → Y
  11. Training Data Hypothesis Function Set Model Goodness of function Framework

    18 h 1 ( ) = “cat” h 1 ( ) = “dog” h 2 ( ) = “cat” h 2 ( ) = “bird” f( ) = “cat” f( ) = “dog” f( ) = “bird”
  12. Training Data Hypothesis Function Set Model Goodness of function Framework

    19 Pick the best function f( ) = “cat” f( ) = “dog” f( ) = “bird” Target Function Target Function, f : X → Y
  13. Training Data Hypothesis Function Set Model Goodness of function Framework

    20 Pick the best function f( ) = “cat” f( ) = “dog” f( ) = “bird” Testing Data h*( ) = “cat”
  14. Training Data Hypothesis Function Set Model Goodness of function Framework

    21 Pick the best function f( ) = “cat” f( ) = “dog” f( ) = “bird” Testing Data Training Testing h*( ) = “cat”
  15. Hypothesis Function Set Machine Learning Step Model 3 1 2

    Goodness of function Pick the best function 22
  16. And it just like... when we want to put an

    elephant into a refrigerator 1 2 3 23 Hypothesis Function Set Model Goodness of function Pick the best function
  17. Machine Learning Types of Machine Learning Reinforcement Unsupervised Supervised •

    Labeled data • Direct feeback • Predict outcome /future • Unlabeled data • No feeback • Find hidden structure • Markov Decision Process • Reward function • Learn policy 24
  18. Classification Supervised Regression The class label is discrete. The class

    label is continuous. Label Supervised Learning 25 input 1 input 2 label input
  19. Supervised Learning - Regression • Goal : Learning a function

    for a continuous output. 26 - Housing price prediction size of house estimated price ( scalar ) feature label
  20. Supervised Learning - Classification 28 • Goal : Learning a

    function for a discrete output. ( categorical ) - Email Spam filtering (Binary Classification) Header keyword Spam ? { Yes , No } Header keyword feature class label
  21. Supervised Learning - Classification 30 - Document classification - Medical

    diagnosis - Categorical : not ill, cold, flu - Weather - Categorical : sunny, cloud, rain, snow
  22. Supervised Learning - Structured Learning 31 • Structured Data -

    beyond classification - Machine Translation - Speech Recognition 歡迎來修AI課程
  23. Unsupervised Learning - Clustering • A grouping of objects such

    that the objects in a group (cluster) are ◦ Similar to one another in a group ◦ Different from the objects in other groups 37 (slides by Cheng-Te Li) - K-means
  24. 42 Unsupervised Learning - Dimension Reduction X function Z High

    Dimension Low Dimension • Feature Selection (quoted from Hung-yi Lee’s slides) • Principal Component Analysis (PCA) z = Wx
  25. Reinforcement learning(強化學習) is another learning paradigm in machine learning. •

    Inspired from control theory and animal learning. • The learning agent will look around the environment and make a decision. 44 Reinforcement Learning Observation, Environment Feedback Decision
  26. Reinforcement Learning - inspiration How do we teach animal to

    learn expected reaction? Give reward 45
  27. In theory, if we can modeled a decision problem as

    a Markov Decision Process (MDP) and we can apply reinforcement learning to handle such problem. we need to define the following component in MDP: • State Space: How many possibilities in observation? • Action Space: What can I do with the environment? • Reward function: How good or bad about the decision? • Transition: Which state do I transfer to in the next time? 47 Reinforcement Learning - MDP
  28. Reinforcement Learning - MDP 48 At each step t the

    agent: • Receives scalar reward R t • Receives observaiotn O t • Executes action A t The environment: • Receives action A t • Emits observation O t+1 • Emits scalar reward R t+1 Image credits: David Silver’s reinforcement Learning course in UCL, UK.
  29. Reinforcement Learning - MDP A MDP can be recorded as

    the following sequence: 49 We often call this sequence as Trajectory or Episode, denoted by Observation/State, Reward Action
  30. Reinforcement Learning - objective The objective of reinforcement learning is

    to learn the policy that can maximize expected total rewards in different MDPs. 50
  31. Reinforcement Learning - algorithms development Currently, the reinforcement learning algorithms

    are under development and have been tested in different kinds of environments: 51 Video Games Board Games (The state space of 19x19 Go is 10171) Robotics
  32. Reinforcement Learning - resources Course: • The best choice to

    engaged in deep reinforcement learning is CS294, UCB. • Another famous course is David Silver’s reinforcement learning in UCL. • The deep learning course from 吳尚鴻老師 in NTHU. • The reinforcement learning/deep learning course from 李宏毅老師 in NTU. You can find wonderful materials on Youtube. • We also have short courses about reinforcement learning in NCKU: ◦ https://netdbncku.github.io/dsai/2018/ 52
  33. Reinforcement Learning - resources Currently, there are just few reading

    materials about reinforcement learning: • Reinforcement Learning: An Introduction ◦ The second edition will be published recently, and you can find the online draft. • Algorithms for Reinforcement Learning ◦ This book describes more details about reinforcement learning algorithms. • Top Conference Papers ◦ ICLR, NIPS, ICML, AAAI, ... 53 BTW, before you learn reinforcement learning, you had better to learn the basics of machine learning.
  34. Deep Learning Deep learning just means using deep neural network

    as your model(function approximator) in machine learning. 55
  35. Deep Learning Recently, the deep learning won big success in

    many domains and it can be applied in different kinds of learning paradigm to handle unstructured data. • Supervised learning: object detection ... • Unsupervised learning: generative adversarial network(GAN), auto-encoder • Reinforcement learning: robotics, power distribution, chatbot, NLP ... 56
  36. GAN - image-to-image translation 59 Quoted from Isola et al.,

    “Image-to-Image Translation with Conditional Adversarial Networks”
  37. Style Transfer 60 Qutoed from Gatys et al., “Image Style

    Transfer Using Convolutional Neural Networks” (CVPR2016)
  38. Deep Reinforcement Learning - OpenAI Five Train the agents to

    play DOTA2 and they can cooperate with each others. (2018/8/6) 64 https://blog.openai.com/openai-five-benchmark-results/
  39. Deep Learning We will cover the basic contents of deep

    learning in the 3rd lecture, but there are some prerequisite: • The concept of Matrix, vector multiplication. • The concept of partial derivative and chain rule (knowing derivative is OK.) 65
  40. Supervised Learning Regression Classification Linear Model Structured Learning Non-linear Model

    Deep Learning decision tree, SVM, ... Unsupervised Learning Reinforcement Learning Paradigm Task Method 68
  41. Supervised Learning Regression Classification Linear Model Structured Learning Non-linear Model

    Deep Learning decision tree, SVM, ... Unsupervised Learning Reinforcement Learning Paradigm Task Method 69
  42. Hypothesis Function Set Machine Learning Step Model 3 1 2

    Goodness of function Pick the best function 70
  43. Hypothesis Function Set Goodness of function Training Data Model Testing

    Data Pick the best function Cost Function Cost Function : 71 Example:
  44. Hypothesis Function Set Goodness of function Training Data Model Testing

    Data Pick the best function Cost Function 73 Use optimization method to find optimal parameters of hypothesis!
  45. Optimization Method • There are many optimization method to find

    optimal parameters of hypothesis. ◦ Gradient Descent/Ascent ◦ Least Square Method ◦ Linear programming/Quadratic Programming ◦ Newton’s Method ◦ Genetic Algorithms 74
  46. Hypothesis Function Set Goodness of function Training Data Model Testing

    Data Pick the best function Cost Function 75 Gradient Descent
  47. Gradient Descent • Choose an initial value , where 0

    denotes the number of iteration. 77
  48. Gradient Descent • Choose an initial value . • Compute

    . • Compute . learning rate : iteration... 82
  49. Gradient Descent • Choose an initial value . • Compute

    . • Compute . Local Optimal learning rate : iteration... 83
  50. Gradient Descent • Choose an initial value . • Compute

    . • Compute . Local Optimal Glogbal Optimal iteration... learning rate : 84
  51. Get Data • Data analysis competition platform ◦ kaggle •

    Open data ◦ 政府資料開放平臺 ◦ 86
  52. Data Pre-processing - Data type constraints: int, string, boolean -

    Accuracy: outlier, noise… - Completeness: missing value… - Feature Scaling 88
  53. 90 Training & Test Data All Data Training Data Test

    Data Training : Test 80% : 20% 75% : 25%
  54. 100