0

Machine Learning with TensorFlow.js | Aaron Ma

Aaron Ma

9/7/20 at

Angular
English

Angular 9+ demo machine learning application with TensorFlow.js. This talk is the flagship machine learning with TensorFlow.js that delivers unique learning with immersive projects that stretches your mind. We’ll start by learning the basics and perfect your knowledge of Machine Learning and TensorFlow.js by building a digit classifier. Then, we’ll develop our expertise in core TensorFlow.js concepts and Reinforcement Learning(RL) and develop a self-driving car that learns how to drive itself. We’ll finish off by adding a touch of the magic of neural networks to our Angular application by building an image classifier. (all demos made with 💖 using Angular 9+)
Watch all the ng-conf: Hardwired presentations/videos at https://videos.ng-conf.org
ng-conf is a three-day Angular conference focused on delivering the highest quality training in the Angular JavaScript framework. 1500+ developers from across the globe converge on Salt Lake City, UT every year to attend talks and workshops by the Angular team and community experts.
ng-conf: Hardwired is brought to you by: - https://thinkster.io/ - https://herodevs.com/ - https://xlts.dev/
Follow us on twitter https://twitter.com/ngconf Official Website: https://www.ng-conf.org/

Transcript

Hello, it's Aaron today I'll be talking about a journey into the world of machine learning the technology. So who am I? Well, I'm Arima, eight million years old, and I have tremendous passion, computer science, ever since I was five and a half. Court software and hardware golfer and the world's youngest tangible contributor of the world's youngest graduated from USC, silting our engineering program and much more. And you can follow me on Twitter at Erasmo. So every day when I go to my computer, I only go to Google, come to see today's. So we celebrate an event, for example, the first one, the two thousand people will come some. So we will celebrate a festival like Chili's eighty thousand eighty. Some of these juices are just fun to watch, but this is my favorite. This celebrates the birth of Johann Sebastian Bach and that is best ever. It's the world's first artificial intelligence powered doodle. Let's take a look at this that you can see here. There's a very cool open box experience here. So what's box has been open and start randomly clicking notes here. Then can harmonize in the inbounding machine learning automatically endnotes your composition to make your company sound like we're backward. It feels like. Once it's done, you can download it, share with your friends and also edit it in only three days, more than 50 million people have interacted with this tool in every single continent on Earth except Antarctica. It also became a social phenomena when it was trending on Twitter. So why was it so successful? But because the machine learning about highly interactive experiments to take place on various devices. Plus, there are no drivers for installation due process. And also it's secure. All the data stays on device. So users note they have a secure connection. So this duel is powered by Tenzer flowcharts. So most of your income hardwire English experts that the touch of the magic of machine learning, you can make a lot of English and machine power, plus customers will love it and will power, whether it's what exactly is machine learning? Well, it's a study of a complex algorithm and statistical models. It has the ability to learn and improve its own experience without being explicitly program. It any human intervention or assistance. The goal in machine learning is to find the algorithm of the and biases by tweaking the parameters. So Michala is not magic is very using technology. Your questions based on data from on the left hand side of the human pipeline, we gather data and apply a prepositioning technique to the data is in a similar format for Enel then on the right hand side and pipeline gameplay learning algorithm. And then when Trimmel are modeling in the relationship between a data set and the answers finally to match between, we can testament to how well the model has learned is that during training the let's take a look at that in a human friendly way. So let's meet John. John loves listening to music. He loves music. That's a festival. And the John a rock that he disliked music with a slow tempo and the genre pop so we can pop this like music and dislike music x y axis. As you can see here, the x axis in music genre from pop rock, the y axis, the music tempo malac to fact. So let's say John sings a new song Master of Puppets. Finally, where do you think the plot will be at if he gets the point somewhere here? You're correct. How about that guy? Where do you think the U.S. is? Right here. You're correct. But what we can do here is use a machine learning technique known as years, numerous algorithm or cannon. What's does is draws a circle around a discipline. Now you see the majority that don't like the song. Now let's talk about traditional learning, which is the new machine learning curriculum. So traditions of commitment are we know that the outcome, we just read books and that is the ultimate, but she took in pairs, in pairs and pairs of women involved, picked up the album, we noticed, introduced traditional stuff, the more focusing on a code. But machine learning, we're more focusing on how that has been represented. Let's take a look at a simple theory of that. Hello. Oh, I'm sure there are so many languages to say hello. So traditional stuff for the moment. Let's write Tim Cook, based on the text, knows what language it is. So in English it's Hello So Detector's Hello, which is English and French. Hello, is bonjour. So the text is not hello English, French and Spanish. It's not on bonjour. English, definitely Spanish. But what language. This is it. Hello. What. Oh no. Our mail has no idea what that means. So the was was that in stuff. Grobman everything possible scenario that might happen. But we're done with that. You'd be like this but there are so many other things that you were right. What's your name and goodbye. Noah, well, let's use the magic wand machine to start off with other and the other things are moral in relationship where the answer rules so swell and get what language and in our machine my has a prediction that is ninety two percent Chinese, so we can safely go and say that the language is probably Chinese, much better than others thinking which machine why we shouldn't use. Well I got your our friend. To the top three machine, well, as of today, are Tinseltown's rangers at emulsify gas? Let's take a look at the statistics that you just never the clearly Petroulias with almost every single category, have a girlfriend in the past four months. Clearly, this is a winner in Dallas in past three months. But clearly, security is still lower. In fact, as of March 9th, the Dallas Elmasry over Brangus downloads. So the winner of the machine learning battle is drum roll, please. Jazz, yes. So technology is contribution. In the past 12 months has skyrocketed this month to one point four million dollars and 10 million TV hits. I think it is essential to open source artificial intelligence that allows you to machine in JavaScript and use machine learning in the browser or Noguez and designed to be consistent. Well, let me just completely out from scratch, not about intensive and can run as well as Josh. You can run really fast as you accelerated. So the term tend to flow, reflecting what's happening inside where that flows, the neural networks and other data processing of. So Tenzer can think of it as a type of commonly used in algebra, it's immutable, but can you calculate arithmetic operations? They can think of ten as just like a chance to write more like a multidimensional JavaScript read that they're going to use technology as the first way is use of pretreatment directly for inferencing or use of the customization of your own data, or finally dwelt in three miles of crash to flexible APIs. So tendrils, yes, support for back there, just step back and just wait for elections, would you? Back in 53 percent of all devices, the GOP base and A.J. is backing that allows Maltzman on a server, on the browser and also Internet of Things devices. And also Wasem GCP based in C++, keeping the browser friendly. What we believe is coming soon is expected to have even better performance and waddill. So now it's down. Get the technology is for India, their power webapp. So let's get started today. You can use Preachin Miles directly for inferencing, but I'll cover about that in the next slide. Existing technology is readable format. Technology is what finally you can see most directly that that any intelligence technology provides for most common machinery, including, but not limited to working computer vision, architecture, speech, Americanization or natural language processing. You find the source of like with all of these between miles, when the technology is models get up repository and currently there are 13 empty packages, but this is growing every single day of central malls. So some ideas for what that along with technology is because augmented reality, for example, the Loreal company made a virtual makeup and hair color try on out of control. Yes. And there's also real time body segmentation. It went about 45 on to the 50 Maplecroft and twenty one feet on the Apple iPhone X. So 10 years is a very vibrant community. They're extensions, libraries, and so much for they're go on top of jazz just to name a few extensions come up these days. And five basic real simple detection, each estimation in motion in general recreation in the Bouser of technology is Penderecki, as well as real time detection based on hand gestures in the browser. Finally, it will find you from some more amazing and more in matter. It's all just sort of a public audience. So they are thinking, how fast is tendrils? Yes, well, let's use the military to benchmark when the laptop computers runs around 20 milliseconds of infant son. Well, Apple's iPhone X. Twenty two seconds, but Google's picked three inches long improvement with so eight milliseconds. The U.S. is actively working on addressing them on the server side. Well, no, you one click at three milliseconds of influence on a lot of people, actually, nine milliseconds. The preferred front on note is on par with both BP and back, in some cases even faster than the native flow. What do you want, your tangible dress code? You can read anywhere on a modern browser, Molloy's No Gas and Electric Raspberry Pi for Internet Things. It truly is a bill once run anywhere philosophy. The Lepke started with 10 days in your application to start off a new English application. Then until 10 p.m., make sure your configuration set liability to your compiler options and compile or try to compile. As with the projects, Jesus provides highly detailed documentation and trials on how to get started, and I highly recommend you check them out for now, consider this your coopetition drugs here. One Virgin and Pennsauken Technologies, just like you importing Portuguese then or on an IT function here. I'm cataloging why people just want to make to the browser developer tool console. Trust me, if you can learn Artigas indefinitely. Master Control is now my grand finale. Drum roll please. And record digit classification lab. This lab rehabilitatable gizmo in the browser. They'll recognize having digits that we will write the convolutional, Your Honor. So here's the plan for trying to classer like two thousand of Amerindians images in separate labels. The separate binary file then xiuzhi that we will write that the model has never seen before. If I just let this is the latest version of anger and tangible data. So as with all machine learning projects, we need data so that we end this data or modify National Institute of Standards Technology. And there's 65 total images in this dataset. It's all comprised once by it's around 10 megabyte. So each of these images, 28 by 20 pixels and so greyscale. So let's take a look at a demo of this other click this link here, but only showing it here so that everyone can see here. So here's a place where we'll be drawing to numbers between zero and nine is predicting number will be shown here. So I have a dream, Malia, so let's say it is right to say no more often. So I dream of more than 40 bucks. You can see that the data is all 20 by 20 pixels in three, so it's my visor here. I can see in architecture and also my maltreating statistics. Don't worry if this doesn't make sense, I'll talk about it in just a few minutes. So now that model has been trained now can set ranges, for example, one. OK, I guess this doesn't work. Let's just go to ten bucks, so for 10 epochs, satiric two and it's predicted and that's pretty good. How about three? In particular, it's nine. And how about nine and particularly nine, so my model for tennis is pretty good, except for misclassify one of them. So let's say I trained for 40 bucks. Let's take a look at my model again. So I'm just going to predict it. She does pretty good about sex. And clearly I'm all here for 40 bucks is pretty good. But what just happened there? Well, let's take a look at that. So start first step of all products that you need, clean data and then loaded down, just the data is already clean. We don't need cleaning. We just need to load it up so we cope and clean and misstate a class. We can find the source code at this urinal here. So what this class does is fetches despite the shuttle image list. As you can see, all these images are twenty four point greyscale. One more important thing that this class does. Let's take you to a trailblazer and a testing user. The training that these women use to teach Mimos test data set the date I'm going to use to evaluate the performance of my mom. So now we need to build them up to Bill and I'm going to use a sequential model, which by far is the most simplest and most popular model architecture. My mom actually will have six layer the first layer to be able to feed my data and do my more than before, which will perform the required computation for my model. Finally, a thin layer. Be the output Amama. So I'm going to add an input layer using the model, the API, the commercial to layer, what this does is create a coalitional kernel which produces ticha outputs. So an integer is twenty by twenty one, the twenty by twenty eight, which time. Right. And the one is in the channel, which is ratio. I'll also be using the real activation function, which keeps all the pause, basically all the negative. Then there going to Denslow, which you can think of as a free kick in your network with no problem with this is basically just a number of classes and fitting into your neural network in this case and also be using the softness activation function, which seems a tenuous probability distributions into one inch, whatever the probability index is, the highest is going to be a predicted number. Now we need compilers so we can compile and using the all not compile API, Palm Island optimizer loss and the metrics, the optimizer is going to tell them all to improve on its accuracy. Loss for the error and metrics can evaluate the performance. Remote optimizer. We'll use enum or Adaptive Mowatt estimation, and it's most commonly used for stochastic gradient descent. Let's take a look at that. So as we see from this slide, your gradient descent, you think of it as a ball. The lowest point of the ball is our goal. We also need to set a learning rate as a ball so as ball putting it into drink so you shoot the ball too fast, you shoot the ball too slow, you're not going to have enough momentum to get to the ball, which is a ball. And you'll be using is cost entropy to measured the error between the probability distribution by the last layer of the ball and the probability distribution given by the true label. And the metrics and accuracy now we need Tramel when we train them all on the train deicer in this case, train X, which is our data set and train one, which is going to train labels, will also set the size of 500 TROL and they define the box of matches will train on will be Ivankov and a number of epochs validations data is Prender. Premier of the data that we're using to validate our model is test X and Y. We'll also be setting the true. Which is going to make sure our data set is not in the order. So on the graph, you're first out here, you see the lines move there, that's good as we're minimizing the error of our model. The second graph, there's one is going up. It's telling us that our model is maximizing its accuracy. She learned almost there was a loss to maximize the accuracy of our model. So I my model on twenty five epochs, and this is what I got, I got an accuracy and a confusion matrix. So accuracy, for example, how did you get Class nine? I've been in three three examples to me, mom. I got one hundred percent of accuracy. Some of these are not so good for the last three. I've been in 50, for example. Super model. Eighty nine percent accuracy. Here's a challenge for you can play out of my model and also the number of epoxy to get better validation scored than what I got. So now we make a prediction. So whenever the user write something in the chemist called the execute the cancer and get you straight to the user back in the UN. So you can find the source code for Distomo at this get up repository here. So congratulations on making through this talk, just a few more slides from done here. So currently there's a Twitter campaign. We can see what the community's main issue is using the hashtag made with PFG. Yes. As Larry Page once said, artificial intelligence was the ultimate version of Google, thank you for the inspirational quote, the A.I. Larry Page. So here's a Mexican machine you always stuff in you like. Which one should you first? Well, that's what I'm today. I'm watching also tend to forget which you can find at this repository, which is a crime list of dedicated resources to help you master control. Now, my takeaways of my talk this morning is using technology to answer questions of data. And she caught up heavy and cold. And currently androgenous is the most popular machine learning job, Larry. And getting started, simple, just the easier using the machine machines for everyone machine at room, which means you using your chair. You can become a machine engineer with a little help from Google Fojas. Can you hear me? Machine learning is for everyone and machines for everyone, which means you yeah, you sitting your chair, you can become a machine or an engineer with a little girl central. So thank you for listening. I'm Emma. Don't forget, check out my school website and come to me. You are high at your local reforging. Our out-of-date and geopolitical mantrip earning Schmock will be pushed my in all of the demos used regularly. And we should thank you for listening and have a great day.

Newsletter

Receive the most recent recordings from meetups and conferences in your inbox monthly

About MeetupFeed

MeetupFeed collects and organizes recordings from tech meetups and conferences. Follow your global community!

Disclaimer: This site is not associated, affiliated, endorsed, or sponsored by Meetup.com. None of the videos are our own.