- How does Ai work?
- Tensorflow.js: What is it?
- Deploying your Ai enabled App
- Now what?
How does Ai work?
In very simple terms, Ai learns through trial and error. It is given loads of data, which could be images, texts or even voice data.
The Neural Net recognises patterns in the data and learns from it.
Let's understand with the help of an example.
Tom is a 3 year-old boy, he does not know the difference between a dog and a cat. So we try to teach him what a dog looks like and what a cat looks like. We have to stacks of images, one with cats and one with dogs.
We show Tom pictures of dogs and cats and after he has learnt what they look like, we try to test how much he has learnt.
In order to learn the differences between the dogs and the cats he must have looked at the characteristics of them, for eg: Dogs are taller than Cats.
Let's say we asked him to identify 10 random images which have both cats and dogs(mixed), and he answers 8 correctly, he has a 80% accuracy.
Now simply replace Tom with a computer and you have Machine Learning, incredibly easy to understand, isn't it? This kind of Machine learning is called "Supervised learning".
What is TensorFlow.js
Tensorflow.js is a Js library by Google which allows us to make Machine learning models(the thing we did above) for the the browser.All computations happen in the clients' browser this means your web app is 100% privacy friendly as no data is sent back.
The cool thing about TensorFlow.js is that you don't even need to train your own models to use Ai! You can use pre-trained models which you can simply import in your project. This is fine when you're starting out but it is recommended that you train you own models.
Now take a look at this tutorial: Google CodeLabs tutorial
Deploying your Ai enabled App
Deploying a Tensorflow.js web app to the web is super simple.
Push to a Github Repo and then import it in Vercel/Netlify, just like a normal website deployment.
Here's an Web App I made using Tfjs: Digit Recognizer Using MNIST Dataset
In a future thread we'll a more in depth look on how a neural network works and some other concepts.