This is a simple tutorial of how create a Tensorflow model and how to use this model in a application.
With Machine Learning you can:
- Predict values using the historical data.
- Classify based on features
- ...
Tensor is a Google framework that helps you add Machine Learning to your application.
Machines will never learning anything.
Machine only recognizes patterns.
So the first step for using a Machine Learning approaches is teach the machine to recognizes a pattern. This means you should train the machine and creates a model.
No! There is a mathematical model to preview the output based on a train.
Let me explain better.
Our trainning set is composed of rows, each row is a historical data. For each row we have at least one feature and one real data. Let's create an equation where is a matrix for all the input values and is all the real data.
Now we are guessing that exists a vector that can convert each input data in their respective output.
does not exists! But if we find any values that minimizes the error, we can contruct a model that predicts the output.
The first step for using Tensorflow is create the trainning environment.
You can see at Dockerfile who you can setup the environment for trainging and prepare the data.
With everything running fine, you should start trainning your model. You can see here how it can be done.
Running the train container, you can inspect the trainning you had done at http://localhost:6006.
docker build -t mlt-trainning train/
docker run -p 6006:6006 --name mlt -i -t mlt
You can see in the gcloud scripts how install an upload the model to Google Cloud.
Before you run theses scripts you should:
- Create a project at Google Cloud Console
- Create a credentials file at
train/credentials.json
- Enable billing, if you do not enable you cannot upload the model