1 00:00:00,000 --> 00:00:02,370 [No audio] 2 00:00:02,371 --> 00:00:06,202 As part of the prerequisite of most machine 3 00:00:06,203 --> 00:00:10,004 learning projects, we need a training dataset. 4 00:00:10,005 --> 00:00:12,132 A training dataset is a 5 00:00:12,133 --> 00:00:15,370 large group of labeled examples. 6 00:00:15,371 --> 00:00:19,818 A machine learning system is going to learn patterns 7 00:00:19,819 --> 00:00:24,346 inside the training dataset and store that knowledge 8 00:00:24,347 --> 00:00:27,770 in something that is called a model. 9 00:00:27,771 --> 00:00:31,788 This model is supposed to define as close 10 00:00:31,789 --> 00:00:36,812 as possible the relationship between features and the 11 00:00:36,813 --> 00:00:40,358 target label, in a common type of machine 12 00:00:40,359 --> 00:00:43,260 learning method called supervised learning. 13 00:00:43,950 --> 00:00:47,776 The way to create this kind of model is 14 00:00:47,777 --> 00:00:52,650 based on analyzing a large group of labeled examples. 15 00:00:52,651 --> 00:00:55,140 We are basically training our 16 00:00:55,141 --> 00:00:58,030 model using the labeled examples. 17 00:00:58,610 --> 00:01:02,756 Once we have trained our model with those 18 00:01:02,757 --> 00:01:08,230 labeled examples, we can use that trained model 19 00:01:08,231 --> 00:01:13,330 to predict the label on unlabeled examples. 20 00:01:14,390 --> 00:01:18,924 When looking on the lifecycle of a model in 21 00:01:18,925 --> 00:01:21,938 a machine learning system, we have two main phases. 22 00:01:21,939 --> 00:01:24,716 The training phase or also called the 23 00:01:24,717 --> 00:01:28,012 learning phase, which means creating the model. 24 00:01:28,013 --> 00:01:31,232 The main idea is to utilize or 25 00:01:31,233 --> 00:01:34,896 use some learning algorithms that will build 26 00:01:34,897 --> 00:01:37,936 a model using the training dataset. 27 00:01:37,937 --> 00:01:41,690 There are all kinds of learning algorithms 28 00:01:41,691 --> 00:01:44,320 and we'll talk about them later. 29 00:01:45,170 --> 00:01:48,228 After training a model, we would like to use 30 00:01:48,229 --> 00:01:51,066 it in the real world to perform something useful. 31 00:01:51,067 --> 00:01:53,416 So the next phase or the next 32 00:01:53,417 --> 00:01:56,910 stage of a model is called inference. 33 00:01:56,911 --> 00:02:01,246 In machine learning, inference means applying 34 00:02:01,247 --> 00:02:03,992 the trained model in an actual 35 00:02:03,993 --> 00:02:05,932 machine learning system working in a 36 00:02:05,933 --> 00:02:10,250 production environment for making ongoing predictions. 37 00:02:10,251 --> 00:02:14,514 It is also important to mention that this inference 38 00:02:14,515 --> 00:02:19,152 represent a specific snapshot of the trained model. 39 00:02:19,153 --> 00:02:23,936 In many practical machine learning use cases, the system will 40 00:02:23,937 --> 00:02:29,056 keep training new and better models all the time using 41 00:02:29,057 --> 00:02:33,370 new data, and in some time interval it will replace 42 00:02:33,371 --> 00:02:36,640 an existing inference with a new one. 43 00:02:38,130 --> 00:02:42,132 As a nice example, let's say we would like to develop 44 00:02:42,133 --> 00:02:49,192 a mobile application that can recognize the type of animal from 45 00:02:49,193 --> 00:02:53,336 a picture taking in real time by the end user. Okay. 46 00:02:53,337 --> 00:02:57,052 So as part of the training phase, we will 47 00:02:57,053 --> 00:02:59,868 have a very large dataset to train a 48 00:02:59,869 --> 00:03:04,870 model like 1 million images of different animals. 49 00:03:05,450 --> 00:03:09,648 This training process will be performed in 50 00:03:09,649 --> 00:03:13,750 a dedicated, very expensive hardware setup located 51 00:03:13,751 --> 00:03:16,288 in a centralized data center. 52 00:03:16,289 --> 00:03:20,128 All the images used for training are located in 53 00:03:20,129 --> 00:03:24,004 the same data center. After the training is done, 54 00:03:24,005 --> 00:03:26,666 okay, now we are moving to the next stage. 55 00:03:26,667 --> 00:03:30,660 We have a trained model that can be sent 56 00:03:30,661 --> 00:03:35,695 as a snapshot to the end user mobile devices. 57 00:03:35,830 --> 00:03:38,616 So when someone is taking a picture using 58 00:03:38,617 --> 00:03:42,472 her or his phone, the local application on 59 00:03:42,473 --> 00:03:47,850 the mobile device can immediately identify or classify 60 00:03:47,851 --> 00:03:51,394 the type of animal on that picture. 61 00:03:51,395 --> 00:03:55,298 The inference stage, which is the actual prediction 62 00:03:55,299 --> 00:04:00,256 or classification, is done on the device level. Okay. 63 00:04:00,257 --> 00:04:03,382 Another option is to perform the inference 64 00:04:03,383 --> 00:04:06,448 stage in the centralized data center. 65 00:04:06,449 --> 00:04:09,734 So the end user will take a picture. 66 00:04:09,735 --> 00:04:14,290 The picture will be sent as raw data to the cloud. Okay. 67 00:04:14,291 --> 00:04:18,291 And in the cloud there will be an application which 68 00:04:18,292 --> 00:04:21,529 will use the latest model to perform the inference. 69 00:04:21,530 --> 00:04:26,154 The result will be sent back to the end user device. 70 00:04:26,155 --> 00:04:28,314 There are, of course all kind of prons 71 00:04:28,315 --> 00:04:32,276 and cons like latency issue and so on. 72 00:04:32,277 --> 00:04:35,708 Today, because of the end user devices that we 73 00:04:35,709 --> 00:04:39,788 are using today are getting faster and better. 74 00:04:39,789 --> 00:04:42,988 So there are more and more use cases where the 75 00:04:42,989 --> 00:04:47,510 inference can be done on the end user device. 76 00:04:47,511 --> 00:04:49,808 [No audio]