This is a simple project demonstrating the most basic ML example I could find on the internet:
https://developers.google.com/codelabs/tensorflow-1-helloworld#0
There were three or four questions I wanted to answer with this example:
- What is the simples ML example of training a model I could write?
- Give me a simple example using TensorFlow so I can start to get familiar with it.
- When the model is created, where does it 'live' and how might I re-use it without having to train it every time.
- Given a simple ML example, how does it's computation compare to a programmed version of the same? This is one key question I have about ML models, especially with regard to chess, for example. How do trained chess ML models compare with the hand-crafted chess game engines? Are they better, worse, faster, slower? This example is too simple to provide an answer, but the comparison is interesting, I think.
First, you'll need to install TensorFlow and Numpy:
pip install --upgrade pip
pip install tensorflow
pipe install numpy
- Then run the training example:
python3 train_hello_world.py
- To re-use the model you just generated, run:
python3 use_hello_world.py
- Finally, to run a simple function to calculate the same results, run:
python3 simple_func.py