[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.26,0:00:03.42,Default,,0000,0000,0000,,What we hope to do with this meetup Dialogue: 0,0:00:03.85,0:00:10.62,Default,,0000,0000,0000,,is have something, given the spread of \Nthe questionnaire results Dialogue: 0,0:00:10.62,0:00:12.68,Default,,0000,0000,0000,,we hope to do something which is kind of\N Dialogue: 0,0:00:12.68,0:00:15.72,Default,,0000,0000,0000,,for people who don't know what\Ndeep learning is Dialogue: 0,0:00:15.72,0:00:17.99,Default,,0000,0000,0000,,and want an introduction to TensorFlow Dialogue: 0,0:00:17.99,0:00:20.32,Default,,0000,0000,0000,,but also something which is more of a Dialogue: 0,0:00:20.32,0:00:24.02,Default,,0000,0000,0000,,like a crowd pleaser or something\Nwhich is more cutting edge Dialogue: 0,0:00:24.02,0:00:27.08,Default,,0000,0000,0000,,I am not going to say that this \Nthing is particularly cutting edge Dialogue: 0,0:00:27.08,0:00:31.55,Default,,0000,0000,0000,,because once we saw the responses,\Nwe dialed things down a bit Dialogue: 0,0:00:31.55,0:00:37.80,Default,,0000,0000,0000,,But there will be more cutting edge stuff Dialogue: 0,0:00:37.80,0:00:42.81,Default,,0000,0000,0000,,and maybe we start to do other meetups\Nevents in other formats Dialogue: 0,0:00:42.81,0:00:48.82,Default,,0000,0000,0000,,So it could be like we have \Nan experts' paper meeting Dialogue: 0,0:00:48.82,0:00:52.86,Default,,0000,0000,0000,,or we could split it now we can see \Nthe size of people, size of the crowd Dialogue: 0,0:00:52.86,0:00:57.82,Default,,0000,0000,0000,,Anyway, let me talk a little bit about\Ngoing deeper with transfer learning Dialogue: 0,0:00:57.82,0:01:00.16,Default,,0000,0000,0000,,Unfortunately, this is something \Nsome of you people Dialogue: 0,0:01:00.16,0:01:02.50,Default,,0000,0000,0000,,would have seen me do before Dialogue: 0,0:01:02.50,0:01:04.88,Default,,0000,0000,0000,,This is the first time I have \Ndone it in tensorflow Dialogue: 0,0:01:05.12,0:01:07.27,Default,,0000,0000,0000,,and let me just explain that Dialogue: 0,0:01:07.27,0:01:10.16,Default,,0000,0000,0000,,Before, I have been programming this stuff Dialogue: 0,0:01:10.16,0:01:13.38,Default,,0000,0000,0000,,in Theano with the \NLasagna layers thing on top Dialogue: 0,0:01:13.38,0:01:19.43,Default,,0000,0000,0000,,and Theano is a research-based \Ndeep learning framework, out of Montreal Dialogue: 0,0:01:19.43,0:01:22.68,Default,,0000,0000,0000,,but what I have concluded\Nsince last summer Dialogue: 0,0:01:22.68,0:01:26.64,Default,,0000,0000,0000,,is that TensorFlow 's probably the winner\Nof this framework race Dialogue: 0,0:01:26.64,0:01:29.43,Default,,0000,0000,0000,,at least for foreseeable future Dialogue: 0,0:01:29.43,0:01:31.86,Default,,0000,0000,0000,,with all this nice industrial stuff Dialogue: 0,0:01:31.89,0:01:35.15,Default,,0000,0000,0000,,I should be retooling into TensorFlow Dialogue: 0,0:01:35.52,0:01:37.48,Default,,0000,0000,0000,,That's what I am taking the opportunity\Nto do for this Dialogue: 0,0:01:40.95,0:01:43.07,Default,,0000,0000,0000,,So, about me, sorry here we go Dialogue: 0,0:01:43.07,0:01:45.68,Default,,0000,0000,0000,,I have come up through finance, \Nstartups and stuff Dialogue: 0,0:01:45.68,0:01:49.65,Default,,0000,0000,0000,,I took a year out basically in 2014\Njust for fun Dialogue: 0,0:01:49.65,0:01:53.56,Default,,0000,0000,0000,,I have been doing serious kind of \Nnatural language processing since then Dialogue: 0,0:02:00.91,0:02:04.63,Default,,0000,0000,0000,,Basically, the overview for this\Nsomething more challenging talk Dialogue: 0,0:02:04.63,0:02:08.67,Default,,0000,0000,0000,,which will probably be 20 mins, 30 mins\Ndepending on how it goes Dialogue: 0,0:02:08.67,0:02:13.89,Default,,0000,0000,0000,,I want to take a state-of-the-art\NTensorFlow model Dialogue: 0,0:02:13.89,0:02:16.77,Default,,0000,0000,0000,,I want to solve a problem that \Nit wasn't trained for Dialogue: 0,0:02:16.77,0:02:20.93,Default,,0000,0000,0000,,And I am going to be using \Ndeep learning as a component Dialogue: 0,0:02:20.93,0:02:25.96,Default,,0000,0000,0000,,of my solution rather than the \Nprimary focus of what I am trying to build Dialogue: 0,0:02:25.96,0:02:32.90,Default,,0000,0000,0000,,So this is, in a way more of an industrial\Nor commercial kind of application Dialogue: 0,0:02:32.91,0:02:35.19,Default,,0000,0000,0000,,for what's going on here Dialogue: 0,0:02:35.19,0:02:38.51,Default,,0000,0000,0000,,So the goal for this kind of problem is Dialogue: 0,0:02:38.51,0:02:42.53,Default,,0000,0000,0000,,I want to distinguish pictures\Nof classic and modern sports cars Dialogue: 0,0:02:42.53,0:02:47.05,Default,,0000,0000,0000,,you will see some pictures of \Nclassic and modern cars a bit later Dialogue: 0,0:02:48.43,0:02:51.72,Default,,0000,0000,0000,,It's not that easy to say what\Nthe difference is Dialogue: 0,0:02:51.72,0:02:55.21,Default,,0000,0000,0000,,obviously, it could be \Ndifferent types of images Dialogue: 0,0:02:55.21,0:02:57.45,Default,,0000,0000,0000,,and it could be lots of \Ndifferent classes Dialogue: 0,0:02:57.45,0:03:00.99,Default,,0000,0000,0000,,I am just doing a very simple \Ntwo class thing Dialogue: 0,0:03:00.99,0:03:03.14,Default,,0000,0000,0000,,but it's complicated images Dialogue: 0,0:03:03.14,0:03:04.82,Default,,0000,0000,0000,,what I want to do is Dialogue: 0,0:03:04.82,0:03:06.11,Default,,0000,0000,0000,,I want to have a very small training time Dialogue: 0,0:03:06.11,0:03:08.38,Default,,0000,0000,0000,,so I don't want to be retraining \Nsome huge network Dialogue: 0,0:03:08.38,0:03:12.90,Default,,0000,0000,0000,,Particularly, I have only got \Nin this case, 20 training examples Dialogue: 0,0:03:12.90,0:03:18.20,Default,,0000,0000,0000,,So I am not gonna do any fantastic\Nmillion image training Dialogue: 0,0:03:18.20,0:03:20.86,Default,,0000,0000,0000,,I have got 20 images with me Dialogue: 0,0:03:20.86,0:03:24.70,Default,,0000,0000,0000,,and I also want to be able to\Nput this in production Dialogue: 0,0:03:24.70,0:03:30.12,Default,,0000,0000,0000,,so I can just run it as a component of \Nsomething else Dialogue: 0,0:03:30.12,0:03:36.40,Default,,0000,0000,0000,,Basically, one of the things that is \Ncarrying the deep learning world forward Dialogue: 0,0:03:36.40,0:03:40.20,Default,,0000,0000,0000,,is an image classification task \Ncalled ImageNet Dialogue: 0,0:03:40.20,0:03:42.41,Default,,0000,0000,0000,,this has been a competition where Dialogue: 0,0:03:42.41,0:03:47.41,Default,,0000,0000,0000,,they have 15 million labeled images\Nfrom 22,000 categories Dialogue: 0,0:03:47.41,0:03:49.86,Default,,0000,0000,0000,,and you can see some of them here Dialogue: 0,0:03:49.86,0:03:55.82,Default,,0000,0000,0000,,if we go for this.\Nthis is a picture of a hotdog in a bun Dialogue: 0,0:03:55.82,0:03:57.79,Default,,0000,0000,0000,,and here are some of the categories Dialogue: 0,0:03:57.79,0:04:02.54,Default,,0000,0000,0000,,which will be some food I don't know Dialogue: 0,0:04:02.54,0:04:06.11,Default,,0000,0000,0000,,these are hotdogs, lots of \Ndifferent pictures of hotdogs Dialogue: 0,0:04:06.11,0:04:09.06,Default,,0000,0000,0000,,lots of different pictures of cheeseburgers Dialogue: 0,0:04:09.06,0:04:11.85,Default,,0000,0000,0000,,lots of different pictures of plates Dialogue: 0,0:04:11.85,0:04:15.34,Default,,0000,0000,0000,,so the task for ImageNet is to classify Dialogue: 0,0:04:15.34,0:04:18.27,Default,,0000,0000,0000,,for any given, any one of these images Dialogue: 0,0:04:18.27,0:04:20.45,Default,,0000,0000,0000,,which of a thousand different \Ncategories it is from Dialogue: 0,0:04:20.45,0:04:25.33,Default,,0000,0000,0000,,and it used to be that people could\Nscore adequately well Dialogue: 0,0:04:25.33,0:04:28.56,Default,,0000,0000,0000,,and were making incremental changes in Dialogue: 0,0:04:28.56,0:04:30.56,Default,,0000,0000,0000,,how well they can do this Dialogue: 0,0:04:30.56,0:04:32.100,Default,,0000,0000,0000,,but the deep learning people came along Dialogue: 0,0:04:32.100,0:04:35.49,Default,,0000,0000,0000,,and kind of tore this to shreds Dialogue: 0,0:04:35.49,0:04:40.15,Default,,0000,0000,0000,,and Google came up with GoogLeNet Dialogue: 0,0:04:40.15,0:04:43.91,Default,,0000,0000,0000,,what we are actually going to use here,\Nback in 2014 Dialogue: 0,0:04:43.91,0:04:49.65,Default,,0000,0000,0000,,suddenly, this stuff is now being done\Nwith further iterations Dialogue: 0,0:04:49.65,0:04:52.81,Default,,0000,0000,0000,,of this kind of thing,\Nbetter than humans can Dialogue: 0,0:04:52.81,0:04:56.80,Default,,0000,0000,0000,,So the way you can measure whether\Nsomeone is better than humans Dialogue: 0,0:04:56.80,0:04:59.07,Default,,0000,0000,0000,,is, you take a human and see\Nwhether it beats him Dialogue: 0,0:04:59.07,0:05:01.56,Default,,0000,0000,0000,,the question there is \Nare there labeling errors Dialogue: 0,0:05:01.56,0:05:03.72,Default,,0000,0000,0000,,there you need a committee of humans Dialogue: 0,0:05:03.72,0:05:06.25,Default,,0000,0000,0000,,so the way they label these things is Dialogue: 0,0:05:06.25,0:05:08.74,Default,,0000,0000,0000,,by running it on Mechanical Turk and Dialogue: 0,0:05:08.74,0:05:12.49,Default,,0000,0000,0000,,asking people what category is this\Ncheeseburger in Dialogue: 0,0:05:14.82,0:05:16.38,Default,,0000,0000,0000,,The network we are going to use here Dialogue: 0,0:05:16.38,0:05:23.42,Default,,0000,0000,0000,,is the 2014 state-of-the-art GoogLeNet,\Nalso called Inception version 1 Dialogue: 0,0:05:23.42,0:05:25.69,Default,,0000,0000,0000,,The nice thing about this is that Dialogue: 0,0:05:25.69,0:05:30.94,Default,,0000,0000,0000,,there is an existing model\Nalready trained for this task Dialogue: 0,0:05:30.94,0:05:33.77,Default,,0000,0000,0000,,and it's available for download\Nit's all free Dialogue: 0,0:05:33.77,0:05:38.95,Default,,0000,0000,0000,,and there are lots of different \Nmodels out there Dialogue: 0,0:05:38.95,0:05:41.36,Default,,0000,0000,0000,,there's a model zoo for TensorFlow Dialogue: 0,0:05:41.36,0:05:44.35,Default,,0000,0000,0000,,So, what I have on my machine Dialogue: 0,0:05:44.35,0:05:48.53,Default,,0000,0000,0000,,and this is a small model, \Nit's a 20 megabytes kind of model Dialogue: 0,0:05:48.53,0:05:50.28,Default,,0000,0000,0000,,So it is not a very big model Dialogue: 0,0:05:50.28,0:05:57.29,Default,,0000,0000,0000,,Inception 4 is a 200 MB kind of model\Nwhich is a bit heavy Dialogue: 0,0:05:57.29,0:05:59.42,Default,,0000,0000,0000,,I am working here on my laptop Dialogue: 0,0:05:59.42,0:06:01.21,Default,,0000,0000,0000,,you are gonna see it working in real-time Dialogue: 0,0:06:01.21,0:06:07.25,Default,,0000,0000,0000,,and the trick here is instead of \Na softmax layer at the end Dialogue: 0,0:06:07.25,0:06:12.98,Default,,0000,0000,0000,,I will show you the diagram, it should be \Nclear to anyone who's following along Dialogue: 0,0:06:12.98,0:06:19.08,Default,,0000,0000,0000,,instead of using logits to get me \Nthe probablilities Dialogue: 0,0:06:19.08,0:06:21.13,Default,,0000,0000,0000,,I am going to strip that away Dialogue: 0,0:06:21.13,0:06:23.07,Default,,0000,0000,0000,,and I am going to train \Na support vector machine Dialogue: 0,0:06:23.07,0:06:24.88,Default,,0000,0000,0000,,to distinguish these classes Dialogue: 0,0:06:24.88,0:06:29.85,Default,,0000,0000,0000,,I am not going to retrain the \NInception network at all Dialogue: 0,0:06:29.85,0:06:32.47,Default,,0000,0000,0000,,I am going to just use it as a component Dialogue: 0,0:06:32.47,0:06:34.91,Default,,0000,0000,0000,,strip off the top classification piece Dialogue: 0,0:06:34.91,0:06:38.23,Default,,0000,0000,0000,,and replace it with an SVM Dialogue: 0,0:06:38.23,0:06:40.38,Default,,0000,0000,0000,,Now, SVMs are pretty well understood Dialogue: 0,0:06:40.38,0:06:44.62,Default,,0000,0000,0000,,here I am just using Inception \Nas a featurizer for images Dialogue: 0,0:06:44.62,0:06:47.28,Default,,0000,0000,0000,,So here's a network picture Dialogue: 0,0:06:47.28,0:06:52.02,Default,,0000,0000,0000,,Basically, this is what the ImageNet \Nnetwork is designed for Dialogue: 0,0:06:52.02,0:06:54.33,Default,,0000,0000,0000,,you put in an image at the bottom Dialogue: 0,0:06:54.33,0:06:57.44,Default,,0000,0000,0000,,there is this black box which is the \NInception network Dialogue: 0,0:06:57.44,0:07:00.74,Default,,0000,0000,0000,,which is a bunch of CNNs or \Nconvolutional neural networks Dialogue: 0,0:07:00.74,0:07:02.60,Default,,0000,0000,0000,,followed by Dense network Dialogue: 0,0:07:02.60,0:07:04.85,Default,,0000,0000,0000,,followed by these logits Dialogue: 0,0:07:04.85,0:07:07.98,Default,,0000,0000,0000,,and these logits layers is essentially \Nthe same as the 0 to 10 Dialogue: 0,0:07:07.98,0:07:17.04,Default,,0000,0000,0000,,that Sam had for his digits, 1 to 1000 \Nfor the different classes for ImageNet Dialogue: 0,0:07:17.04,0:07:20.42,Default,,0000,0000,0000,,To actually get the ImageNet output Dialogue: 0,0:07:20.42,0:07:27.39,Default,,0000,0000,0000,,it uses a softmax function and \Nthen chooses the highest one of these Dialogue: 0,0:07:27.39,0:07:28.91,Default,,0000,0000,0000,,to give you this is the class\Nthat this is in Dialogue: 0,0:07:28.91,0:07:32.17,Default,,0000,0000,0000,,What I am going to do is \NI am going to ignore this Dialogue: 0,0:07:32.17,0:07:35.34,Default,,0000,0000,0000,,neat piece of classification technology\Nthat they have got Dialogue: 0,0:07:35.34,0:07:44.15,Default,,0000,0000,0000,,let's say we use these outputs as inputs\Nto SVM and just treat these as features Dialogue: 0,0:07:44.15,0:07:46.57,Default,,0000,0000,0000,,Now if we pick out one of these Dialogue: 0,0:07:46.57,0:07:50.70,Default,,0000,0000,0000,,this class could be cheeseburger\Nand this class could be parrot Dialogue: 0,0:07:50.70,0:07:54.07,Default,,0000,0000,0000,,and this other class could be Husky dog Dialogue: 0,0:07:54.07,0:07:57.18,Default,,0000,0000,0000,,there is all sorts of classes in here Dialogue: 0,0:07:57.18,0:07:59.71,Default,,0000,0000,0000,,but basically what I will be doing is that Dialogue: 0,0:07:59.71,0:08:02.25,Default,,0000,0000,0000,,I will be extracting out the features \Nof these photos Dialogue: 0,0:08:02.25,0:08:04.95,Default,,0000,0000,0000,,saying how much of this photo \Nis like a parrot Dialogue: 0,0:08:04.95,0:08:08.94,Default,,0000,0000,0000,,how much of this is like a Husky dog Dialogue: 0,0:08:08.94,0:08:13.23,Default,,0000,0000,0000,,Now it turns out that modern cars and \Nclassic cars can be distinguised that way Dialogue: 0,0:08:13.23,0:08:18.66,Default,,0000,0000,0000,,Let me go to some code Dialogue: 0,0:08:18.66,0:08:20.60,Default,,0000,0000,0000,,Ok this code is all up on GitHub Dialogue: 0,0:08:30.95,0:08:34.30,Default,,0000,0000,0000,,Can everyone see this enough Dialogue: 0,0:08:38.38,0:08:42.23,Default,,0000,0000,0000,,So basically, I am pulling in TensorFlow Dialogue: 0,0:08:45.40,0:08:49.25,Default,,0000,0000,0000,,I pull in this model Dialogue: 0,0:08:49.25,0:08:52.78,Default,,0000,0000,0000,,Here is what the Inception architecture is Dialogue: 0,0:08:52.78,0:08:56.97,Default,,0000,0000,0000,,It feeds forward this way,\Nhere you put your image Dialogue: 0,0:08:56.97,0:08:59.90,Default,,0000,0000,0000,,it goes through lots and lots of \Nconvolutional layers Dialogue: 0,0:08:59.90,0:09:03.49,Default,,0000,0000,0000,,all the way up to the end \Nwith softmax and the output Dialogue: 0,0:09:03.49,0:09:06.92,Default,,0000,0000,0000,,So having done that, what I will do is Dialogue: 0,0:09:06.92,0:09:09.74,Default,,0000,0000,0000,,actually I have a download \Nfor the checkpoint Dialogue: 0,0:09:09.74,0:09:16.56,Default,,0000,0000,0000,,this is the checkpoint here which \Nis a tar file, I have it locally stored Dialogue: 0,0:09:16.56,0:09:18.50,Default,,0000,0000,0000,,It doesn't download it now Dialogue: 0,0:09:18.50,0:09:25.26,Default,,0000,0000,0000,,but it is all there, even the \Nbig models are there up from Google Dialogue: 0,0:09:25.26,0:09:27.76,Default,,0000,0000,0000,,so they have retrained these Dialogue: 0,0:09:27.76,0:09:30.48,Default,,0000,0000,0000,,so the Inception thing takes about a week Dialogue: 0,0:09:30.48,0:09:33.79,Default,,0000,0000,0000,,to retrain on a bunch of, \Nit could be 64 GPUs Dialogue: 0,0:09:33.79,0:09:36.86,Default,,0000,0000,0000,,so you don't really want to be\Ntraining this thing on your own Dialogue: 0,0:09:36.86,0:09:40.79,Default,,0000,0000,0000,,you also need the ImageNet training set\N Dialogue: 0,0:09:40.79,0:09:48.38,Default,,0000,0000,0000,,it is a 140 GB file \Nwhich is no fun to download Dialogue: 0,0:09:50.82,0:09:57.18,Default,,0000,0000,0000,,what I am doing here is basically\Nthere is also an Inception library Dialogue: 0,0:09:57.18,0:10:04.04,Default,,0000,0000,0000,,which is part of the TF-Slim \Nthis thing is desinged such that Dialogue: 0,0:10:04.04,0:10:08.26,Default,,0000,0000,0000,,it already knows the network\Nit can preload it Dialogue: 0,0:10:08.26,0:10:12.29,Default,,0000,0000,0000,,this has loaded it, \NI can get some labels Dialogue: 0,0:10:12.29,0:10:17.18,Default,,0000,0000,0000,,This is loading up the ImageNet labels Dialogue: 0,0:10:17.18,0:10:25.56,Default,,0000,0000,0000,,I need to know which location \Ncorresponds to which class like the digits Dialogue: 0,0:10:31.28,0:10:33.30,Default,,0000,0000,0000,,Here we are going through \Nbasically the same steps Dialogue: 0,0:10:33.30,0:10:39.07,Default,,0000,0000,0000,,as the MNIST example in that\Nwe reset the default graph Dialogue: 0,0:10:39.07,0:10:44.59,Default,,0000,0000,0000,,we create a placeholder which is \Nwhere my images are going to go Dialogue: 0,0:10:44.59,0:10:47.58,Default,,0000,0000,0000,,this is as an input \Nbut from this image input Dialogue: 0,0:10:47.58,0:10:49.90,Default,,0000,0000,0000,,I am then going to do some TensorFlow steps Dialogue: 0,0:10:49.90,0:10:52.29,Default,,0000,0000,0000,,because TensorFlow \Nhas various preprocessing Dialogue: 0,0:10:52.29,0:10:55.77,Default,,0000,0000,0000,,or graphics handling commands Dialogue: 0,0:10:55.77,0:10:57.75,Default,,0000,0000,0000,,because a lot of this stuff\Nworks with images Dialogue: 0,0:10:57.75,0:11:02.55,Default,,0000,0000,0000,,so there's all sorts of clipping\Nand rotating stuff Dialogue: 0,0:11:02.55,0:11:04.78,Default,,0000,0000,0000,,so it can preprocess these images Dialogue: 0,0:11:04.78,0:11:08.48,Default,,0000,0000,0000,,I am also going to pull out a numpy image Dialogue: 0,0:11:08.48,0:11:10.83,Default,,0000,0000,0000,,so I can see what it is actually looking at Dialogue: 0,0:11:10.83,0:11:14.85,Default,,0000,0000,0000,,here with this Inception version 1 Dialogue: 0,0:11:14.85,0:11:20.91,Default,,0000,0000,0000,,I am going to pull in the entire\NInception version 1 model Dialogue: 0,0:11:23.36,0:11:26.57,Default,,0000,0000,0000,,My net function rather than being \Njust picks and random weights Dialogue: 0,0:11:26.57,0:11:29.98,Default,,0000,0000,0000,,is gonna be assigned this \Nfrom this checkpoint Dialogue: 0,0:11:29.98,0:11:34.42,Default,,0000,0000,0000,,when I run the init thing from my graph Dialogue: 0,0:11:34.42,0:11:37.48,Default,,0000,0000,0000,,or in my session, it won't initialize\Neverything from random Dialogue: 0,0:11:37.48,0:11:39.48,Default,,0000,0000,0000,,it will initialize everything from disk Dialogue: 0,0:11:39.48,0:11:42.03,Default,,0000,0000,0000,,so this will define the model Dialogue: 0,0:11:42.03,0:11:45.36,Default,,0000,0000,0000,,and now let's proceed Dialogue: 0,0:11:45.36,0:11:51.61,Default,,0000,0000,0000,,one of the issues with having this \Non a nice TensorFlow graph Dialogue: 0,0:11:51.61,0:11:56.66,Default,,0000,0000,0000,,is it just says input, Inception1, output Dialogue: 0,0:11:56.66,0:11:59.94,Default,,0000,0000,0000,,so there's a big block there \Nyou can delve into it if you want Dialogue: 0,0:11:59.94,0:12:05.79,Default,,0000,0000,0000,,let me just show you\Nlet's go back a bit Dialogue: 0,0:12:08.32,0:12:11.30,Default,,0000,0000,0000,,So this is the code \Nbehind the Inception1 model Dialogue: 0,0:12:11.30,0:12:16.06,Default,,0000,0000,0000,,so this is actually smaller than the \NInception2 and Inception3 Dialogue: 0,0:12:16.06,0:12:22.33,Default,,0000,0000,0000,,basically, we have a kind of a base\NInception piece, just this Dialogue: 0,0:12:22.33,0:12:24.97,Default,,0000,0000,0000,,and these are combined together Dialogue: 0,0:12:24.97,0:12:33.44,Default,,0000,0000,0000,,and this is a detailed model put together \Nby many smart people in 2014 Dialogue: 0,0:12:33.44,0:12:35.47,Default,,0000,0000,0000,,it's got much more complicated since then Dialogue: 0,0:12:35.47,0:12:38.91,Default,,0000,0000,0000,,fortunately, they have written the code \Nand we don't have to Dialogue: 0,0:12:43.42,0:12:46.32,Default,,0000,0000,0000,,So here what I am gonna do is \NI am gonna load an example image Dialogue: 0,0:12:46.32,0:12:50.58,Default,,0000,0000,0000,,just to show you\None of the the things here is Dialogue: 0,0:12:50.58,0:12:56.40,Default,,0000,0000,0000,,TensorFlow in order to become efficient\Nwants to do the loading itself Dialogue: 0,0:12:56.40,0:13:01.34,Default,,0000,0000,0000,,So in order to get this pumping \Ninformation through Dialogue: 0,0:13:01.34,0:13:03.63,Default,,0000,0000,0000,,it wants you to set up hues of images Dialogue: 0,0:13:03.63,0:13:10.26,Default,,0000,0000,0000,,it will then handle the whole ingestion\Nprocess itself Dialogue: 0,0:13:10.26,0:13:14.15,Default,,0000,0000,0000,,the problem with that is \Nit's kind of complicated to do Dialogue: 0,0:13:14.15,0:13:16.02,Default,,0000,0000,0000,,in a Jupyter notebook right here Dialogue: 0,0:13:16.02,0:13:19.13,Default,,0000,0000,0000,,so here I am going to do \Nthe very simplest thing Dialogue: 0,0:13:19.13,0:13:22.39,Default,,0000,0000,0000,,which is load a numpy image \Nand stuff the numpy image in Dialogue: 0,0:13:22.39,0:13:24.88,Default,,0000,0000,0000,,but what TensorFlow would love me to do Dialogue: 0,0:13:24.88,0:13:29.41,Default,,0000,0000,0000,,is create , as you see in this one Dialogue: 0,0:13:29.41,0:13:34.02,Default,,0000,0000,0000,,create a file name queue and it will Dialogue: 0,0:13:34.02,0:13:35.31,Default,,0000,0000,0000,,then run the queue, do the matching Dialogue: 0,0:13:35.31,0:13:36.67,Default,,0000,0000,0000,,and do all of this stuff itself Dialogue: 0,0:13:36.67,0:13:41.09,Default,,0000,0000,0000,,because then it can lay it out across \Npotentially distributed cluster Dialogue: 0,0:13:41.09,0:13:43.41,Default,,0000,0000,0000,,and do everything just right Dialogue: 0,0:13:43.41,0:13:50.25,Default,,0000,0000,0000,,here I do kind of the simple read the image Dialogue: 0,0:13:50.25,0:13:59.51,Default,,0000,0000,0000,,so this image is a tensor \Nwhich is 224 by 224 by RGB Dialogue: 0,0:13:59.51,0:14:03.48,Default,,0000,0000,0000,,this is kind of sanity check\Nwhat kind of numbers I got in the corner Dialogue: 0,0:14:03.48,0:14:05.67,Default,,0000,0000,0000,,and then what I am gonna do is Dialogue: 0,0:14:05.67,0:14:08.02,Default,,0000,0000,0000,,i am going to crop out the \Nmiddle section of it Dialogue: 0,0:14:08.02,0:14:10.76,Default,,0000,0000,0000,,this happens to be the right size already Dialogue: 0,0:14:10.76,0:14:13.50,Default,,0000,0000,0000,,basically if you got odd shapes Dialogue: 0,0:14:13.50,0:14:15.14,Default,,0000,0000,0000,,you need to think about \Nhow am I gonna do it Dialogue: 0,0:14:15.14,0:14:18.96,Default,,0000,0000,0000,,am I going to pad it\Nwhat do you do Dialogue: 0,0:14:18.96,0:14:21.95,Default,,0000,0000,0000,,because in order to make this efficient Dialogue: 0,0:14:21.95,0:14:29.06,Default,,0000,0000,0000,,TensorFlow wants to lay it out without \Nall this variability in image size Dialogue: 0,0:14:29.06,0:14:34.48,Default,,0000,0000,0000,,one set of parameters and it's then going\Nto blast it across your GPU Dialogue: 0,0:14:34.48,0:14:37.86,Default,,0000,0000,0000,,so let's just run this thing Dialogue: 0,0:14:37.86,0:14:39.70,Default,,0000,0000,0000,,so now we have defined the network Dialogue: 0,0:14:39.70,0:14:45.77,Default,,0000,0000,0000,,here I am going to pick a session\Nhere I am going to init the session Dialogue: 0,0:14:45.77,0:14:47.84,Default,,0000,0000,0000,,it loads the data, and then I am going Dialogue: 0,0:14:47.84,0:14:52.04,Default,,0000,0000,0000,,to pick up the numpy image and the\Nprobabilities from the top layer Dialogue: 0,0:14:52.04,0:14:54.68,Default,,0000,0000,0000,,I am just gonna show it Dialogue: 0,0:14:57.51,0:15:01.37,Default,,0000,0000,0000,,here is the image \Nthis is image I pulled out of the disk Dialogue: 0,0:15:01.37,0:15:06.33,Default,,0000,0000,0000,,you can see here the probabilities, \Nthe highest probability is Tabby cat Dialogue: 0,0:15:06.33,0:15:10.49,Default,,0000,0000,0000,,which is good, it's also interesting that Dialogue: 0,0:15:10.49,0:15:15.26,Default,,0000,0000,0000,,the second in line things are Tiger cat,\NEgyptian cat, lynx Dialogue: 0,0:15:15.26,0:15:21.04,Default,,0000,0000,0000,,so it's got a fair idea that it is a cat\Nin particular, it is getting it right Dialogue: 0,0:15:21.04,0:15:26.17,Default,,0000,0000,0000,,ok so this is the same diagram \Nwe have had before Dialogue: 0,0:15:26.17,0:15:32.73,Default,,0000,0000,0000,,what you have seen is this going in this \Nblack box, coming out and telling us Dialogue: 0,0:15:32.73,0:15:35.87,Default,,0000,0000,0000,,the probabilities here, so what we are \Nnow gonna do is Dialogue: 0,0:15:35.87,0:15:41.91,Default,,0000,0000,0000,,from the image to the black box and \Njust learn a bunch of features Dialogue: 0,0:15:50.03,0:15:52.72,Default,,0000,0000,0000,,let me just show you this on disk Dialogue: 0,0:16:11.30,0:16:13.30,Default,,0000,0000,0000,,so I have a cars directory here Dialogue: 0,0:16:13.96,0:16:17.85,Default,,0000,0000,0000,,and inside this thing, Dialogue: 0,0:16:24.24,0:16:25.79,Default,,0000,0000,0000,,I have surprisingly little data Dialogue: 0,0:16:36.65,0:16:39.86,Default,,0000,0000,0000,,In this directory, I just have a \Nbunch of car images Dialogue: 0,0:16:39.86,0:16:42.19,Default,,0000,0000,0000,,and I have two sets of images Dialogue: 0,0:16:42.19,0:16:47.66,Default,,0000,0000,0000,,one of which is called classic \Nand the other is called modern Dialogue: 0,0:16:47.66,0:16:52.01,Default,,0000,0000,0000,,so I basically I picked some\Nphotos off Flickr Dialogue: 0,0:16:52.01,0:16:54.44,Default,,0000,0000,0000,,I put these into two separate directories Dialogue: 0,0:16:54.44,0:16:56.31,Default,,0000,0000,0000,,I am going to use those directory names Dialogue: 0,0:16:56.31,0:17:00.43,Default,,0000,0000,0000,,as the classification for these images Dialogue: 0,0:17:00.43,0:17:05.16,Default,,0000,0000,0000,,In the upper directory here\NI got a bunch of test images Dialogue: 0,0:17:05.16,0:17:06.83,Default,,0000,0000,0000,,which I don't know the labels for Dialogue: 0,0:17:12.61,0:17:17.26,Default,,0000,0000,0000,,this picks out the list of classic , there\Nis a classic and a modern directory Dialogue: 0,0:17:17.26,0:17:21.99,Default,,0000,0000,0000,,I am gonna go through every file \Nin this directory Dialogue: 0,0:17:21.99,0:17:28.47,Default,,0000,0000,0000,,I am gonna crop it, I am gonna find \Nthe logits level which is Dialogue: 0,0:17:28.47,0:17:33.44,Default,,0000,0000,0000,,all the classes and then I am just gonna \Nadd these to features Dialogue: 0,0:17:33.44,0:17:36.60,Default,,0000,0000,0000,,So basically I am gonna do something\Nlike a scikit-learn model Dialogue: 0,0:17:36.60,0:17:38.31,Default,,0000,0000,0000,,I am gonna fit SVM Dialogue: 0,0:17:38.31,0:17:42.11,Default,,0000,0000,0000,,so basically, this is featurizing \Nall these pictures Dialogue: 0,0:17:47.91,0:17:49.96,Default,,0000,0000,0000,,so here we go with the training data Dialogue: 0,0:17:55.57,0:17:56.97,Default,,0000,0000,0000,,here's some training Dialogue: 0,0:18:02.27,0:18:05.62,Default,,0000,0000,0000,,classic cars,\Nit went through the classic directory Dialogue: 0,0:18:05.62,0:18:08.78,Default,,0000,0000,0000,,modern cars, \Nit went through the modern directory Dialogue: 0,0:18:15.29,0:18:16.75,Default,,0000,0000,0000,,it's thinking hard Dialogue: 0,0:18:18.39,0:18:25.28,Default,,0000,0000,0000,,what I am gonna do now is \Nbuild SVM over those features Dialogue: 0,0:18:31.02,0:18:40.18,Default,,0000,0000,0000,,jump to 21:36 Dialogue: 0,0:21:35.48,0:21:43.84,Default,,0000,0000,0000,,I restarted this thing Dialogue: 0,0:21:43.84,0:21:49.62,Default,,0000,0000,0000,,the actual training for this SVM thing\Ntakes that long, Dialogue: 0,0:21:49.62,0:21:58.02,Default,,0000,0000,0000,,this is very quick, essentially 20 images \Nworth of a thousand features Dialogue: 0,0:21:58.02,0:22:01.84,Default,,0000,0000,0000,,so there was no big training loop to do Dialogue: 0,0:22:01.84,0:22:09.07,Default,,0000,0000,0000,,then I can run this on the actual models \Nin the directory, in the test set Dialogue: 0,0:22:09.07,0:22:12.68,Default,,0000,0000,0000,,so here this is images that it has never\Nseen before Dialogue: 0,0:22:12.68,0:22:16.44,Default,,0000,0000,0000,,it thinks that this is a modern car Dialogue: 0,0:22:16.44,0:22:19.02,Default,,0000,0000,0000,,this one it thinks is a classic car, \Nthis one is classified as modern Dialogue: 0,0:22:19.02,0:22:26.30,Default,,0000,0000,0000,,so this is actually doing quite a good job\Nout of just 10 examples of each Dialogue: 0,0:22:26.30,0:22:32.77,Default,,0000,0000,0000,,it actually thinks this one is modern\Nit's not a sports car but anyway Dialogue: 0,0:22:32.77,0:22:38.94,Default,,0000,0000,0000,,so this is showing that the SVM we trained Dialogue: 0,0:22:38.94,0:22:42.90,Default,,0000,0000,0000,,can classify based on the features that\NInception is producing because Dialogue: 0,0:22:42.90,0:22:47.23,Default,,0000,0000,0000,,Inception understands "understands"\Nwhat images are about Dialogue: 0,0:22:47.23,0:22:50.80,Default,,0000,0000,0000,,so if I go back to here, \Ncode is on GitHub Dialogue: 0,0:22:50.80,0:22:53.99,Default,,0000,0000,0000,,conclusions okay, this thing really works Dialogue: 0,0:22:53.99,0:22:58.40,Default,,0000,0000,0000,,we didn't have to train \Na deep neural network Dialogue: 0,0:22:58.40,0:23:01.88,Default,,0000,0000,0000,,we could plug this TensorFlow model\Ninto an existing pipeline Dialogue: 0,0:23:01.88,0:23:04.76,Default,,0000,0000,0000,,and this is actually something where Dialogue: 0,0:23:04.76,0:23:08.53,Default,,0000,0000,0000,,the TensorFlow Summit has something\Nto say about these pipelines Dialogue: 0,0:23:08.53,0:23:11.01,Default,,0000,0000,0000,,because not only are they talking\Nabout deep learning Dialogue: 0,0:23:11.01,0:23:14.75,Default,,0000,0000,0000,,they are talking about the whole \Ncloud-based learning Dialogue: 0,0:23:14.75,0:23:19.45,Default,,0000,0000,0000,,and setting up proper processes Dialogue: 0,0:23:19.45,0:23:23.96,Default,,0000,0000,0000,,I guess, time for questions quickly Dialogue: 0,0:23:23.96,0:23:29.14,Default,,0000,0000,0000,,we can then do the \NTensorFlow Summit wrap-up Dialogue: 0,0:23:33.21,0:23:37.14,Default,,0000,0000,0000,,"I am assuming that there is no \Nbackpropagation here" Dialogue: 0,0:23:37.14,0:23:40.03,Default,,0000,0000,0000,,This includes no backpropagation Dialogue: 0,0:23:40.03,0:23:42.50,Default,,0000,0000,0000,,"End result is a feature" Dialogue: 0,0:23:45.88,0:23:53.14,Default,,0000,0000,0000,,I am just assuming that Inception,\Nyou can imagine if the ImageNet thing Dialogue: 0,0:23:53.14,0:23:56.26,Default,,0000,0000,0000,,had focused more on products,\Nit could be even better Dialogue: 0,0:23:56.26,0:23:58.91,Default,,0000,0000,0000,,if it focused on man-made things Dialogue: 0,0:23:58.91,0:24:04.92,Default,,0000,0000,0000,,The ImageNet training set has an awful\Nlot of dogs in it, not that many cats Dialogue: 0,0:24:04.92,0:24:09.43,Default,,0000,0000,0000,,So, on the other hand it may be that \Nit has quite a lot of flowers Dialogue: 0,0:24:09.43,0:24:13.83,Default,,0000,0000,0000,,or maybe that it is saying I like this car\Nas modern car Dialogue: 0,0:24:13.83,0:24:16.05,Default,,0000,0000,0000,,because it's got petals for wheels Dialogue: 0,0:24:16.05,0:24:20.38,Default,,0000,0000,0000,,whereas the other one, the classic cars\Ntend to have round things for wheels Dialogue: 0,0:24:20.38,0:24:25.15,Default,,0000,0000,0000,,So it is abstractly doing this Dialogue: 0,0:24:25.15,0:24:29.92,Default,,0000,0000,0000,,It doesn't know about sports cars or \Nwhat they look like Dialogue: 0,0:24:29.92,0:24:31.59,Default,,0000,0000,0000,,But it does know about curves Dialogue: 0,0:24:34.61,0:24:37.53,Default,,0000,0000,0000,,"So for SVM, you don't use \NTensorFlow anymore ?" Dialogue: 0,0:24:37.53,0:24:43.16,Default,,0000,0000,0000,,No, basically I have used TensorFlow to \Ncreate some features Dialogue: 0,0:24:43.16,0:24:45.31,Default,,0000,0000,0000,,Now, I don't want to throw it away Dialogue: 0,0:24:45.31,0:24:47.69,Default,,0000,0000,0000,,because hopefully I have got\Na streaming process where Dialogue: 0,0:24:47.69,0:24:52.18,Default,,0000,0000,0000,,more and more images are chugged \Nthrough this thing Dialogue: 0,0:24:52.18,0:25:04.53,Default,,0000,0000,0000,,{\i1} could not hear the question properly {\i0} Dialogue: 0,0:25:07.06,0:25:10.07,Default,,0000,0000,0000,,There is an example code called\NTensorFlow for poets Dialogue: 0,0:25:10.07,0:25:13.30,Default,,0000,0000,0000,,where they actually say that, \Nlet's load up one of these networks Dialogue: 0,0:25:13.30,0:25:15.37,Default,,0000,0000,0000,,and then we will do some fine tuning Dialogue: 0,0:25:15.37,0:25:21.98,Default,,0000,0000,0000,,there you get involved in tuning \Nthese neurons with some gradient descent Dialogue: 0,0:25:21.98,0:25:24.82,Default,,0000,0000,0000,,and you are taking some steps \Nand all this kind of thing Dialogue: 0,0:25:24.82,0:25:28.33,Default,,0000,0000,0000,,maybe you are having broad implications\Nacross the whole network Dialogue: 0,0:25:28.33,0:25:32.82,Default,,0000,0000,0000,,which could be good if you have got\Ntons of data and tons of time Dialogue: 0,0:25:32.82,0:25:36.95,Default,,0000,0000,0000,,but this is a very simple way of just\Ntricking it to get it done Dialogue: 0,0:25:36.95,0:25:47.38,Default,,0000,0000,0000,,{\i1} could not hear the comment properly {\i0} Dialogue: 0,0:25:47.38,0:25:54.03,Default,,0000,0000,0000,,it will be a very small network\Nbecause SVM is essentially fairly shallow Dialogue: 0,0:25:54.03,0:26:06.53,Default,,0000,0000,0000,,{\i1}could not hear the question{\i0} Dialogue: 0,0:26:06.53,0:26:13.75,Default,,0000,0000,0000,,TensorFlow even though it has imported\Nthis large Inception network Dialogue: 0,0:26:13.75,0:26:20.57,Default,,0000,0000,0000,,as far as I am concerned, \NI am using a f(x) = y and that's it Dialogue: 0,0:26:20.57,0:26:25.06,Default,,0000,0000,0000,,but you can inquire what would it say\Nat this particular level Dialogue: 0,0:26:25.06,0:26:30.47,Default,,0000,0000,0000,,and these bunches of levels with various\Ncomponent points along the way Dialogue: 0,0:26:30.47,0:26:33.65,Default,,0000,0000,0000,,I could take out other levels Dialogue: 0,0:26:33.65,0:26:35.78,Default,,0000,0000,0000,,I haven't tried it to have a look Dialogue: 0,0:26:35.78,0:26:40.08,Default,,0000,0000,0000,,There you get more like pictures\Nworth of features rather than Dialogue: 0,0:26:40.08,0:26:43.09,Default,,0000,0000,0000,,this string of a 1000 numbers Dialogue: 0,0:26:43.09,0:26:48.88,Default,,0000,0000,0000,,but each intermediate levels \Nwill be pictures with CNN kind of features Dialogue: 0,0:26:48.88,0:26:53.54,Default,,0000,0000,0000,,on the other hand, if you want \Nto play around with this thing Dialogue: 0,0:26:53.54,0:26:57.65,Default,,0000,0000,0000,,there's this nice stuff called \Nthe DeepDream kind of things Dialogue: 0,0:26:57.65,0:27:02.56,Default,,0000,0000,0000,,where they try and match images to \Nbeing interesting images Dialogue: 0,0:27:02.56,0:27:06.45,Default,,0000,0000,0000,,then you do the featurizing that looks at\Ndifferent levels Dialogue: 0,0:27:06.45,0:27:12.42,Default,,0000,0000,0000,,the highest level is a cat but I want all\Nlocal features to be as fishy as possible Dialogue: 0,0:27:12.42,0:27:15.56,Default,,0000,0000,0000,,then you get like a fish-faced cat Dialogue: 0,0:27:15.56,0:27:20.01,Default,,0000,0000,0000,,that's the kind of thing you can do with\Nthese kinds of features in models