Node JS Machine Learning (LIVE)
Key Takeaways
The video demonstrates building a real-time translation app from scratch using Node.js and Tensorflow.js, covering machine learning concepts and practical implementation.
Full Transcript
hello world it's Suraj and welcome to this live stream in this livestream I'm going to be talking about node dot Jas we're gonna be using machine learning for that so the code is going to show up behind me when I move it so it's gonna show up just setting up some lifes a lot of things right now it looks like the code is not behind there we go okay cool cool cool cool cool all right so okay I'm so excited to be here thank you guys for coming so we have a lot to talk about today we are going to build a no dot Jas app from scratch and this app is going to be able to translate in real time so check this out here's a translation demo okay let me make this a little bigger so this is in real time this is what's happening okay I can say how are you and it's going to translate it in real time into French so English to French translation in the browser immediately I can say hello world it's Suraj and then it's going to say you know whatever needs to say okay so that's the demo that we are going to build today this person is saying my left ear is highly educated well guess what your right ear is going to be as well because there's no audio in the left ear okay we're gonna fix that we're gonna fix that for you okay so stay on we're gonna fix that for you in the meantime let's get right into this okay so ah what I want to do is just say five names and then I'm gonna start coding this okay so I'm on preached silly T on and Martin and Deepak and reciate okay and then the question I only see one question have you ever loved anybody yes it's called my community it's called you guys so that's why I do this thing okay so let's make everything big and now we're gonna look at this so I'm gonna talk a little bit about what no Chuck no js' is and then we're gonna talk about how machine translation works using sequence to sequence models and then we're going to code this thing out in JavaScript okay all right so that's let's get right into this so nodejs so JavaScript was initially invented just for sir just for in the browser scripting it wasn't made to create standalone applications right so you wouldn't build a model that allows for requests to be coming in in JavaScript and JavaScript wasn't made initially to handle a bunch of concurrent requests you know like for post requests for for data etc but the developers of nodejs said you know what let's create a JavaScript runtime environment that's an entire environment that you can use JavaScript to create stand-alone web apps and since then it's kind of exploded in popularity look no js' is not a new technology it's it's it's it's a relatively you know in in in programming terms it's an older technology it's about five years or more older but it's a very it's a very good technology and we can use it we can combine it with machine learning for some amazing results so if we look at the analogy of Java so most of us are familiar with Java because computer science 101 classes teach Java generally and if you're not that's okay but basically what I'm trying to show is the analogy of what node runs on and it runs on what's called the v8 engine and v8 engine was created for C++ specifically but but you can use it with JavaScript now and what it does is you type in javascript in the browser and it compiles it down to very fast machine code that's readable by your machine ok so no longer is it campano longer is JavaScript just constrained to the browser you can use it for all sorts of things okay nice audio for you fix the audio all right well it's fine now okay so up the other thing about nodejs is so on if we look at the official nodejs website let's look at the official nodejs website all right no js' is a JavaScript runtime engine built on Chrome's v8 JavaScript engine and what it does is it creates an event and here's look here's a key right here it creates an event-driven non-blocking i/o model that makes it lightweight in efficient let's break this down io means input-output this can be anything from reading files writing local files making an HTTP request write anything that you are inputting into a model and then you're getting an output that's an input-output model but but the problem with input-output models is the idea of blocking right so blocking happens when you make a request and there's another request but wait this request is not finished yet and now it has to wait for the other request right so it's blocked request number two is blocked from from modifying the the app because request one is in process so what JavaScript's nodejs does is it has this thing called the event loop okay and this is what the event loop looks like the event loop consists of three of different modules you have your call stack you have the node api's and you have your callback queue and great two years for the audio awesome and also attention mechanisms I know you guys want attention mechanisms I need to make a dedicated video about attention that's coming you can't just be like oh this is attention but and then that's it no attention is a highly interesting topic it's an advanced topic and we will get into that I know you guys want it I wanted to you know how much I like attention mechanisms but basically the idea of attention mechanisms is normally in a neural network you have a bunch of things to choose from right the network has a bunch of options on what to make a prediction with different sub modules of data and what attention does is it says here is the most important part of that data to pay attention to and here's what to make a prediction with and it when it comes down to is probabilities right what's the percent likelihood that this will result in a output that is most aligned with the label that I have and there's different methods for this there's a whole field of study dedicated to attention mechanisms you could dedicate to three years to this okay so how does machine translation work that was that's noce yet well before I get to machine translation let me just finish explaining nodejs three modules here are the call stack note api's and the callback queue okay this is this is very you know trivial stuff and so here's an example right so what happens is for these three functions well two functions what happens is they are first when you execute this code all those functions go on to the call stack the call stack then calls the node API is write set timeout as a part of the node API and then both are both are placed in the into the callback queue the callback queue is waiting for the call stack to be empty and once it's empty it's going to send one by one different functions to that call stack and then once and any new functions first enter the call stack call the node api's then go to the callback queue and then they're executed in the call stack again so it's kind of this loop right and so what happens is because there's this process that's happening there's no blocking and so what that means is you can make concurrent requests not just one but a thousand requests at the same time and because there's this loop functionality you don't have to wait for one request to finish before starting the other one now on to machine translation here is our input data and our output data okay so what this is let's look at our data set by the way our data set is an input-output data set example LS TM sequence to sequence French data this is a very popular data set and there's a great tutorial for this on the Carrows blog as well mines is going to be more interactive but let's see where the input data is here it is okay so that's really what I want and plus ours is gonna be in JavaScript not in Python so this is our input data okay and this this website has a bunch of great data sets for every language so a bunch of phrases like hello how are you with The Associated other language that it's translated to I'm also going to be taking questions so in five minutes for now I'm gonna be taking questions so be sure to ask those questions before I start coding okay so what we're gonna do is we're going to translate English to French okay so we downloaded an English French pair so the input looks like this left column right here the output looks like this right column right here and what we want to do is learn the mapping exactly we want to learn the mapping between the two and so the first step for us is to pre-process this data so what it's gonna look like is this it's gonna be a set of word vectors and here's what the first word vector will look like go becomes G Oh period that's it and this is going to be an array where every element in the array is a different character that's a part of that phrase and the output will be the same great okay so now for the encoder decoder architecture here's how it works we have two recurrent networks okay we have a one recurrent Network that's the we call the encoder we have another recurrent neural network neural network call the decoder so there's two neural networks here one acts as what's called the encoder and the other as a decoder the encoder is responsible for outputting a fixed length encoding of the input English sentence so recurrent networks are a type of neural network that are fed not just the Newton a new data point in the next time step right so feed-forward networks are fed new data points every time step right so here's one data point here's the next data point here's the next data point and every time step that that hidden weight matrix that that is the neural networks brain essentially it's all of its learnings over time it's a collection of numbers right ones and zeros that gets better and better through the optimization process for normal feed-forward neural networks you're just feeding in input data and that that input that that weight matrix for the network is kind of like play-doh it's being cool it's being molded over time to be more and more optimized right so it's big it's becoming better and better so when you feed it a new output it's gonna give you the perfect when you feed it a new input it's gonna give you the perfect output but where current networks are not just fed in new input data so it's not just new data points it's also the it's also the previous hidden state so it's the previous version of that play-doh weight matrix so it's being fed both of those and the reason for that is because we're current networks are made for learning sequences now it does very well with learning sequences right so predicting the next character the next number the next image the next frame in a sequence of images video it does very well at predicting sequences the problem is that there is a there is a problem with learning long-term memory right so it forgets what happens in the past now I have some great videos on LS TM networks this problem is called the vanishing gradient problem and we can talk about it forever but basically TLDR just search LS TM Siraj for videos on that but the idea is that the gradient vanishes slowly as we back propagate into previous layers and so there's a version of the recurrent Network the version of the recurrent network is called a an LS TM network ok so a long short-term memory network and here's what it looks like and let's talk about this for a second because it's very interesting in addition to having a hidden state this LS TM recurrent network has a cell state and here's what a cell looks like now remember these words gates cells these are just these are just ways for us to understand what this actually is and what this actually is is a series of operations that we are applying to input data and so we have what's called an input gate a forget gate and an output gate and a cell state we have four different things to be thinking about here when we're thinking about an LS TM cell and the whole idea behind this is to trap that gradient over the long term and this kind this this scheme has resulted in us being able to trap that gradient in in earlier layers of the network such that it can remember long term sequences so if you look at these gating variables here these three equations if we look at these three equations alright and I'm gonna answer questions right after this let me just finish this if we look at these three equations we have an equation for the forget gate the input gate and the output gate and its input times weight add a bias and then the parentheses activate remember input times weight add a bias activate these gates are just single layer neural networks right there are perceptrons where we're taking the input multiplying it by its own respective weight matrix adding a bias value and taking that output and what we do with all three of these gates is we compute the cell state so look at this equation right here okay what this equation is is a it is when we are taking all of those against and we are we're saying we're taking to take the the first equation multiply it by this cell state from the previous time step plus the info gate times the cell state and that gives us our cell state and then we take our output times tan H the activation of the cell state and that gives us our hidden state so these two variables right here and this is our cell state from the last time step these two variables right here are what we care about and that's what the LST M computes so when it comes to training here's how it works okay so here is how it works let me just say how it works and then we're good with this okay so what's happening is we take okay we so during the training phase we take our input sentence this is an English sentence okay we take that English sentence and we feed it into the encoder so this is a vectorized version of the English sentence we feed it to the first encoder that the encoder that's an LS TM network now what we care about is not the output we care about the learned hidden state from the encoder and what that hidden state is we can call it a lot of things we could call it a play-doh weight matrix we can call it a we can call it a a hidden state we can call it a thought vector we can call it a learning we can call it a you know it's what it's learned it's it's a dense representation it's it's a compressed version of everything that it's learned over time a generalized version and we use that learned hidden states from the from the from each iteration of the training loop to initialize the decoder so that initial lot so that hidden state that's learned from the encoder is used to initialize the decoder what the decoder is fed is the French sentence so the English sentence check this out you gotta listen to this the English sentence is given to the encoder the encoder will output a hidden state it will have an output but we don't care about that we only care about the hidden state that it's learned we feed the hidden state to the decoder now to to initialize it and we feed the decoder the French sentence so what happens gonna happen is the decoder is going to translate the French sentence using the learned hidden state from the encoder character by character it's going to predict every next character given that input now it's gonna output something that looks very bad at first and but we have the label which is the actual French phrase we'll compare it via some loss function we'll use that to back propagate the gradient across both networks and we repeat until eventually the output is going to be very very similar to the input which is our translated phrase that's for training and then lastly for inference we're gonna encode the input sequence retrieve that state use it for the decoder and then we don't give it a French phrase we just immediately output we predict every next character because we don't have a label okay so now for questions five questions and I'll get to the code we have a we have a lot of great code for you so don't even worry about that okay so question one how is it great for linear algebra linear algebra is the study of algebra applied to groups of numbers right so normally you're multiplying single numbers four times five five times five and Europe you're applying operations to single numbers but when you have groups of numbers matrices which are what neural networks use that are run on GPUs that can do massive parallel computation you need a new type of math to be able to apply operations to groups of numbers at the same time and that's why linear algebra that's what it does and that's why it's important for neural networks question two when is a school of AI starting it's starting right now question three and the next the first course is gonna start in a few weeks so question three what are the benefits of RNN with LST M over R and n with GRU GRU is actually used more often now but I think LS TMS are easier to understand lastly is the app similar to Google Translator yes well I mean Google Translate uses an encoder decoder architecture it's very different than this one now because it's been iterated over time but it's essentially the same idea of encoder and decoder architecture one more question can you explain how data is formatted and how it will be fed in yes data is going to be formatted as an input vector right where every character is its own element in that vector or array and then we're gonna feed that in okay so now let's let's get into the code here where we got here what time are we at okay cool cool cool cool cool cool cool all right so cool so okay where do we begin here so if we go to node J asked what we can do is we can go to no Chuck no js' org we can go to downloads and we can say what type of operating system do we have I have a Mac so I'll click on that and that's gonna install note no js' using a visual manager okay it's a visual package manager once we have that you if you just joined you haven't missed the code part yet so that's the good part the code is gonna be in the video description by the way so definitely click on that so inside of nodejs we can download this we can say let's let's let's look in the docs here well how do we get started with this right no js' looks hard well guides are usually the best place to look in any kind of technical documentation inside of the getting started guide here's how we do it we create a simple sublime file or a simple text file we paste this in and then we hit app and we name it Aptos a s and then we in the command line type in node app dot j s and at localhost 3000 will see the message hello world that's how you install nodejs so what I'm gonna do is I'm gonna get right into the meat of this code that we're going to use it's going to be beautiful and we got to start somewhere so I'm gonna write out this encoder/decoder architecture for ourselves for us and then we're gonna start coding it okay so beautiful so once we've installed tensorflow JSON p.m. installed tensorflow j s we can import it right so there's several ways to be importing tensorflow Jas but what I'm gonna do is I'm going to import it using NPM which is the node package manager now there's also another package manager you should know about yarn which is just as good if not better than NPM that Facebook created because they were having problems with NPM okay they tried everything really but they were still having problems and at the scale of Facebook of course you're going to have problems right so now we're going to load the pre-trained model so this class file will contain the pre-trained model for us that we can use later on what else are we going to import we also have some basic Dom elements that I've written now in a separate file that we're gonna look at but that's really it ten so far Jas is like our main file here and then we're going to talk about the other things okay so now let's load our pre-trained models as well so we're gonna have some pre trained models we're still gonna build models but I just want to load them so we have both options right so we could we could load our pre trained models or we can just okay cool I just wanted to see what people are saying we can download pre train models or we can have it from the web or downloaded from the web so I'm gonna download it from the web I think it's close where's the what were the easy API is called what was this website called okay here we go that's what it was called so these are the this is the so Google has this pre trained model on the web for us as a JSON file to these models are saved as JSON files but it's not just the model there's also metadata right so metadata includes things like versioning information time stamps things like that everything that's around the model but it's not necessarily the model okay so we're gonna initialize this as a constant file these are our hosted model URLs so we can load pre train models will also build the model so don't even worry about it okay so we've got that great now we have our Train model we have our hosted URLs now we can create our translator class so now let's build a translator okay so here's how we do this we define a class called translator inside of the translator class we're going to initialize it and we're gonna use the async function because we don't want to wait for the Dom elements to load when we initialize our class file now we're going to initialize it using the URLs that we are provided we will build our own models for sure now I'm going to initialize that URLs file as it as our own variable I'm going to say well here's our model and we're going to wait for it to load using the await function and I haven't gonna have a function for load load the hosted pre-trained model using the urls dot model okay and we have that okay so that is our model right there what it does the await function by the way it just expresses it that expression just it causes the async function to to pause until this function that that it's awaiting has has loaded so that's why we did that now we're gonna do the same thing using the await method for the metadata right we because we have metadata as well it's not just the model itself we have the metadata and this model actually consists of two parts we have our remember we have our encoder so we're gonna call it prepare encoder model and it has our decoder and in these functions that I'm defining right here we're going to segment out this model and then prepare both of them and I'll return this at the very end that's our initialization function for our translator class okay so let's start off with the metadata because right it's not just the model that we're loading it's the metadata as well we have two different things to be loading here let me also see hi everybody okay I just want to see what everybody's saying cool cool we have people joining in we have people leaving don't leave stay stay okay this is important stuff this is more important than web development in general look machine learning is the future of all code okay everything's gonna be machine learning and if you want to stay on top of things you need to understand how this works starting with metadata okay so back to metadata back to metadata where were we so we can retrieve this metadata from our helper class because we have a helper class here and we're gonna use the loader if remember I imported that loader at the very beginning load hosted meta data using the URLs metadata okay so that's the loader that's our translation metadata now we can say well let's take our decoder and so one of the so now we're gonna retrieve something from the metadata so we remember we're retrieving what would already exist so we can say what we know that one of the variables of the metadata and if we look into tensorflow docs this has these it has these features but one of the variables of the input data or of the metadata is the max sequence length for both the encoder and the decoder okay let me zoom out a bit so people can see what we're talking about here right there we go now we have the same thing for our encoder so we have a max decoder length we have a max encoder length and again we can use that same model to retrieve that and it's going to look very similar except it's going to be called the encoder yes you're right cool max encoder sequence length right okay yes so now we have our decoder or we have our encoder sequence length and now there's there's actually Const yes so conce needs to be let's see translation metadata oh right thanks right there we go thank you right yes thank you guys this is how we do it crowd-sourced debugging so now back to this so we have our we have a token index as well now the reason we're going to use this token index is so we have a way of knowing where in the phrase we are when we are predicting the next character in the sequence we need a way to predict where we are and so the metadata has that and it's called the it's called the input token index now we have that not just for the input but we have this for the target index so now what the target index is is it's the final label that we are trying to predict right so that label is the output french phrase okay so that's our index now that's it for metadata now I want to prepare the encoder model prepare encoder model okay and it's going to take the model as its input so it's going to segment out the encoder model using the the pre trained weights and we can we can do is we can we can train it on our own data right so it's already been trained on you know language pairs but we can just train it ourselves we can just add training to it right and also this is the future of machine learning where you don't necessarily have to train your own model from scratch every time because someone else has done that in the same way that you don't have to write code right you don't have to write all the bare-bones code for everything every time someone has already done that so you import a library the paradigm that we're going to start seeing with machine learning is one where we are not just importing libraries we are importing pre-trained models and not just single models but multiple models trained on multiple different types of data and we can combine all of these models together and then train it on our own data and we won't need as much data because of it it's a much more efficient process now enough of that and let's get back to this okay so up back to the encoder model so what does this look like so how many encoder token encoder token and counts how many encoder tokens do we have right so what these tokens are are the number of characters that we are inputting into the encoder and what we can do is we could say for the length of this and it's going to be a size of shape too because there are three different zero one two so those are the elements in the array there are three different words in a phrase and we can say that's well that's going to be the number of tokens now we have to decide well how many inputs is gonna be in this and we can use the equal sign we could say well modeled input zero that's gonna be that that's gonna be the input to the model now remember we are using the hidden states as the as the initial act as the medium with which to initialize a decoder so so we need to retrieve both of those so we have our hidden state state H which we're gonna retrieve from the models and we're gonna say well here's a specific layer where it's out where it's at but it's not enough to just it's not enough to just say we need the hidden state we also need to have that cell state so remember recall I just talked about LS TM networks and what LS TM networks do is they don't just have they don't just offer hidden states they offer cell states that's what's learned and what does that prevent that prevents the vanishing gradient problem and what does that do that lets us learn long-term sequences okay so that our hidden state that's our cell state and what we can do is we can say well let's create a new list and put those values into this single list that we've just defined and we'll take that list and we'll use it to build the model okay I see you translation metadata input token index it is right translation metadata yes I will use the semicolon consistently we got some we got some JavaScript people in here which is good it's not just all Python people we want diversity we want variety guys okay JavaScript Python look Python is what is obviously where it's at for machine learning and this is kind of controversial to say but if I were to pick a number two language for machine learning I'm gonna pick JavaScript not are not Scala not go not not a MATLAB for sure but it's JavaScript and there's a lot of reasons for that but there's a lot of developer activity around javascript libraries for machine learning and have a great video on that coming out this weekend by the way so now we can build the model so now we're actually using a tensor float JS function TF top model to build this thing and we can say well here are inputs and here are outputs our outputs are going to be the states right because we want those states to be fed into the decoder so that's what we're outputting okay so that's us preparing our encoder and now let's prepare the decoder prepare prepare decoder model using the same remember we are segmenting out this model oh I see I see you're right yes that's what you meant okay I just want to fix some syntax here and now we're back thank you so prepared decoder model looks like this so again we are going to do the same kind of basic idea where we are it's deciding what we are we are trying to see what the number of decoder tokens are going to be this was a num decoder tokens and it's gonna be modeled on input one dot shape and then we're gonna say well okay so let's define our hidden state so we have our constants or hidden state and that hidden state is going to be just that again we have our hidden state now what we need to do is define a latent dimension now the reason we are defining this latent dimension using the hidden state is it's going to help us define the input now let me talk about what exactly I mean by that so it's going to be one less than the hidden States size or length because how many lied people do we have by the way constant latent dimension all right so so we're gonna use this latent dimension to help us define the inputs directly into both hidden states so let me show you what I mean so I have a decoder state input H I have a decoder state input C which is the cell States and then I have a decoder state inputs variable okay so these are our three variables thank you okay thank you all right now now now we're going to actually use some tension flow Jes input functions one is going to be TF input shape using the latent dimension so here is why we use the light and dimension we are using the shape of the hidden state minus one to define the decoder States hidden state okay so it's going to be minus 1 because we are predicting the next character in a sequence right it's not the it's it's going to be the if if the input sequence is T we're predicting T plus 1 so the next one so the input shape has to start one before line 67 thank you letting dimension is the shape we have our name which is going to be decoder state input H okay and now let's do the same thing let's make this a little smaller so we could all see this let's do the same thing for the cell state and we'll do the same thing now these are our inputs now that we've defined both of them now we can say well here's our input H and here's our input C now these are our state inputs right so these are our hidden states and these are our these are our this is our hidden states and our self state okay now that we have both of them now let's retrieve the LS TM model just like that okay so I just want to take a little break to say Quan Lewis klore said how do you convince the public we really live in the machine learning era well it's too hard for a country like Bolivia in suit America believe to believe in that I don't care where you live you can live in Antarctica as long as you have an internet connection and some kind of computing device this could be $100 convert to your local currency Chromebook as long as you can access let me show you this collab research google.com okay you go to this in your browser okay this could even be Internet Explorer like the worst browser ever um but as long as you have a browser you create a notebook you say hello world in that notebook you hit this it's compiling it on an Nvidia k80 GPU you have 12 hours of training time on this thing for free it compiled it on that and it printed it out you have everything you have your algorithms okay that's all available on machine learning subreddit it's available on the toriel's online you have the data it's all available using awesome github public lists reddit or slash datasets you have the education me other youtubers you have the compute here so I don't want to hear I live in South America Bolivia whatever I can't do machine learning I don't care where you are here you can do this so don't ever give me an excuse like that again alright so that's that's enough of that ie will be suing me no no actually Microsoft asked me to make an azure video and I said no so let's see them sue me again alright so here we go back to this where was I I got a little off track got a little passionate about that thank you back to the right right right right thank you okay so on line 70 we have our TF input what what went on here yeah interesting looks fine to me tf2 input H ok so back to the retrieving the LST M model so we can say well here's our decoder and we already have our decoder we're gonna take that last layer of the decoder decoder LST M oh I see I see I see capital L there is no capital hell ok so back to this we're going to define our initial input by saying all those layers going through our decoder lsdm oh I see I see I see thank you Capital high here we go ah gotcha got it cool all right cool so now inputting book capital capital great please zoom guys how much zooming do you want here okay here we go declutter state of LCM inputs 0 so this is our initial input ok this is our initial input and now we can initialize the model using the first input and the hidden States input which we've already defined here so we could say apply outputs equals decoder LS TM how much time it has passed so far decode thanks no I mean like how long has it streamed up decoder inputs State in color state cool thanks alright that's our outputs alright I have about ten more lines of code here so stick around I have ten more lines of code and I'm gonna answer some questions at the very end okay I'm gonna answer some questions so don't go anywhere back to this decoder States inputs right so now I have those outputs so what we want to do is we want to get that last output it hasn't been activated yet we haven't applied a dense fully connected layer to it so we have both of our hidden states by the way we have both of them already both the hidden States and the cell states and what we can do is we can just say let's take the first element of this apply outputs array or list and store that in the decoders hidden States and we'll do the same thing for the cell state and that's just gonna be the next the next one and then we have our hidden so these hidden States are gonna get their own list now that we finally retrieve these hidden States we can we can give them their own lists and so these alone aren't going to do anything we have to apply a fully connected layer to them what this is going to do is going to output a probability value why do we want a probability value that's what the dense layer is because a probability value will allow us a probability value will allow us to make a prediction on what character is the most probable next character right so if it's gonna say you know 70% you know H then it's very likely going to be H as the next character and that's what we apply a dense layer to to it so to get that final output we're gonna use that dense layer to to define that output we have our decoder model all right so that's our that's our final output we applied the dense layer to the outputs and now we have a prediction okay so the decoder model is going to use its its own TF model and it's going to use as input to the decoders inputs concatenated with the states the state inputs thank you and we have our outputs which are the decoder outputs okay that's it for this little portion of code bits okay let's review what I've written here by the way okay let's review this so mine 87 right there we go making sure I got all my I still haven't registered sublime text at this point has just become a meme like I will never register a sublime text because I just I don't know why sublime better like sponsor me or something I don't care it now I don't worry about it I love you sublime I don't know why I just don't want to I like being a rebel back to this I my friend oz Bala bonyen who is helping me livestream that's who's sitting next to me so he's helping me with this livestream stuff okay he's got to be our channel back to this okay so let's just let's just go anybody can go to t fjs examples and here's your all of these examples by the way you have your car pole alright this balance is a cart pole in the browser and it's got a live demo most of them have live demos in the browser that you can see if you just click see the example live I want you to for sure go to this github repository if you haven't yet look at this thing training in the browser okay and so are so what I'm gonna do I'm going to download this right now let me download it let me click open let me go to it terminal let me go into it make this bigger now let's run this ourselves so CD translation and then I'm gonna answer some questions right after I run this demo okay so if we go here let's let's look at this what does it say translation okay it says to do two things yarn and yarn watch so yarn I can do that so what yarn is is it's a version of NPM that Facebook created remember that that can that bypasses a lot of the issues with NPM at scale and so once we've run yarn now we can you run yarn watch and what yarn watch is gonna do is in the browser at our localhost it's going to run that pre-trained model okay at localhost one two three four now it's going to show up here okay that's the whole point is that it needs to show up now we're gonna load that pre train model and we're gonna go ahead and say you are cool do s melons y'all that's my French right there omelette du fromage omelette du fromage okay question time so just ask questions I'm reading all this in real time let's answer some questions here link to everything is gonna be in the video description definitely check out collab research google comm check out the github repository for tents love @j asks i love you the school of AI first course will start in a few weeks I have big things planned for everybody it's a very exciting time right now and yarn does not come with a dupe however you can use yarn with Hadoop why use a different activation function H in one place that's a great question so check out my video which activation function should I use Suraj just Google that any advantage of nodejs over Python are yes one example is the ability to easily use distributed computing right so client-side machine learning involves using the GPUs of whoever the host is and if we use client-side machine learning with JavaScript you can train it on their GPUs in real time now you could do this with Python using Django and flask but it's much easier with JavaScript three more questions how can I make a related word to a specific topic AI okay word to Veck Google that worked or no YouTube that word to vac Suraj but you turn words into vectors and then you can find the similarity between these vectors it's a numerical operation and Rev on says I'm the cutest I'm sure and passionate says deep learning with Django it's not a question last question okay the last question is the shawl the shawl asks can you suggest some good books for linear algebra with regard to machine learning no I'm not gonna I'm not gonna suggest good books why because you can very easily learn linear algebra from three blue one brown okay if you search linear algebra my buddy grant here promoting him right now essence of linear algebra definitely check out this series amazing playlist this is enough watch all of this then watch math of intelligence by me if I do say so myself an amazing playlist okay this is when I was in Europe I was just like going through that I was just so hype you know what I'm saying like I was totally in the zone I was combining art and music and like everything together with machine learning it was sick now I have to outdo that with my first school of ai ai course and I will but that's that's that question okay so anyway I love you too look you guys don't need to qualify I'm not gay okay even if you are gay that's fine who cares okay people are gay that's humans but I love you too it's okay for us to be able to say I love you as men as women whatever okay we are beyond gender roles by the way we are you guys listen we are moving beyond you being a human we're moving beyond these bodies period so forget about gender roles we are merging into this super intelligent civilization using AI so don't even trip about like I'm not gay I love you by the way and lastly will it be free of course it's gonna be free yes it's gonna be free and I have so much content coming out for you this weekend it's gonna blow your mind we are living in such an exciting time right now next week we're gonna have our first school of AI meetup starting I'm gonna contact all the people who I've selected to be Dean's it's gonna be amazing you guys are amazing this is the most important community in the world nobody as the community globally is doing as much in terms of impact and do you know why because nobody's using AI as much as we are we are the most AI aware active hungry ambitious community in the world and it's all thanks to you guys alright so that's it for this I'm not gonna rap because it's kind of laggy right now but I will rap I promise you in the next livestream okay so lots of raps are coming I love you guys and thanks for watching
Original Description
In this live stream, i'll build a real-time translation app from scratch using Node.JS and Tensorflow.js. We'll learn how machine learning can be used to help translate languages theoretically and programmatically. We'll also learn about how Node + Tensorflow work together and what the modern web development workflow that includes machine learning looks like. Get hype!
Code for this video:
https://github.com/llSourcell/Node_JS_Machine_Learning
Please Subscribe! And like. And comment. That's what keeps me going.
Want more education? Connect with me here:
Twitter: https://twitter.com/sirajraval
instagram: https://www.instagram.com/sirajraval
Facebook: https://www.facebook.com/sirajology
This video is apart of my Machine Learning Journey course:
https://github.com/llSourcell/Machine...
More Learning Resources:
https://towardsdatascience.com/sequence-to-sequence-tutorial-4fde3ee798d8
https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
https://blog.keras.io/a-ten-minute-introduction-to-sequence-to-sequence-learning-in-keras.html
https://machinelearningmastery.com/develop-encoder-decoder-model-sequence-sequence-prediction-keras/
https://dzone.com/articles/quick-introduction-how-nodejs
https://github.com/tensorflow/tfjs-examples
Join us in the Wizards Slack channel:
http://wizards.herokuapp.com/
Sign up for the next course at The School of AI:
https://www.theschool.ai
And please support me on Patreon:
https://www.patreon.com/user?u=3191693
Signup for my newsletter for exciting updates in the field of AI:
https://goo.gl/FZzJ5w
Hit the Join button above to sign up to become a member of my channel for access to exclusive content! Join my AI community: http://chatgptschool.io/ Sign up for my AI Sports betting Bot, WagerGPT! (500 spots available):
https://www.wagergpt.co
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Siraj Raval · Siraj Raval · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What is Bitcoin?
Siraj Raval
5 Ways to Use Bitcoin
Siraj Raval
BTC Fever - Siraj [Music Video]
Siraj Raval
5 Reasons to Build Decentralized Apps
Siraj Raval
The Interplanetary File System
Siraj Raval
How to Build a Dapp in 3 min
Siraj Raval
Life Before Smartphones
Siraj Raval
4 Ways to Use Smart Contracts
Siraj Raval
3 Dapps You HAVE to See
Siraj Raval
Char's Life as a BitTorrent Engineer
Siraj Raval
4 Reasons AlphaGo is a Huge Deal
Siraj Raval
Build a Neural Net in 4 Minutes
Siraj Raval
Sentiment Analysis in 4 Minutes
Siraj Raval
The Hackathon Life
Siraj Raval
Your First ML App - Machine Learning for Hackers #1
Siraj Raval
Build an AI Composer - Machine Learning for Hackers #2
Siraj Raval
Build a Game AI - Machine Learning for Hackers #3
Siraj Raval
Build a Movie Recommender - Machine Learning for Hackers #4
Siraj Raval
Build an AI Artist - Machine Learning for Hackers #5
Siraj Raval
Build a Chatbot - ML for Hackers #6
Siraj Raval
Build an AI Reader - Machine Learning for Hackers #7
Siraj Raval
Build an AI Writer - Machine Learning for Hackers #8
Siraj Raval
Build a Chatbot w/ an API - ML for Hackers #9
Siraj Raval
One-Shot Learning - Fresh Machine Learning #1
Siraj Raval
Generative Adversarial Nets - Fresh Machine Learning #2
Siraj Raval
Tone Analysis - Fresh Machine Learning #3
Siraj Raval
Generate Rap Lyrics - Fresh Machine Learning #4
Siraj Raval
Build an Autoencoder in 5 Min - Fresh Machine Learning #5
Siraj Raval
Build a Self Driving Car in 5 Min - Fresh Machine Learning #6
Siraj Raval
Build an Antivirus in 5 Min - Fresh Machine Learning #7
Siraj Raval
TensorFlow in 5 Minutes (tutorial)
Siraj Raval
Build a Recurrent Neural Net in 5 Min
Siraj Raval
Build a Simulation in 5 Min
Siraj Raval
Build a TensorFlow Image Classifier in 5 Min
Siraj Raval
Tensorboard Explained in 5 Min
Siraj Raval
Generate Music in TensorFlow
Siraj Raval
Build a Game Bot (LIVE)
Siraj Raval
Deep Learning Frameworks Compared
Siraj Raval
Introduction - Learn Python for Data Science #1
Siraj Raval
Build a Neural Network (LIVE)
Siraj Raval
Twitter Sentiment Analysis - Learn Python for Data Science #2
Siraj Raval
Recommendation Systems - Learn Python for Data Science #3
Siraj Raval
Predicting Stock Prices - Learn Python for Data Science #4
Siraj Raval
Pong Neural Network (LIVE)
Siraj Raval
Deep Dream in TensorFlow - Learn Python for Data Science #5
Siraj Raval
Visualizing Data with D3.js (LIVE)
Siraj Raval
Genetic Algorithms - Learn Python for Data Science #6
Siraj Raval
Enter Siraj [Music Video]
Siraj Raval
Build a Web Scraper (LIVE)
Siraj Raval
Why is P vs NP Important?
Siraj Raval
How to Make a Neural Network (LIVE)
Siraj Raval
How to Make an Amazing Tensorflow Chatbot Easily
Siraj Raval
How to Make an Amazing Video Game Bot Easily
Siraj Raval
How to Make a Tensorflow Neural Network (LIVE)
Siraj Raval
How to Make a Simple Tensorflow Speech Recognizer
Siraj Raval
Joel Shor - Really Quick Questions with an Awesome Google Engineer
Siraj Raval
How to Make a Path Planning Algorithm Easily (LIVE)
Siraj Raval
The Best Way to Prepare a Dataset Easily
Siraj Raval
Catherine Olsson - Really Quick Questions with an OpenAI Engineer
Siraj Raval
How to Make a Tic Tac Toe Neural Network Easily (LIVE)
Siraj Raval
More on: LLM Foundations
View skill →
🎓
Tutor Explanation
DeepCamp AI