This is a small project which aims to show an example of applied machine learning in Python 3 with the Keras library and its TensorFlow backend to train a neural network model for it to learn to add two integers.
The project also aims to follow the 7 Steps of Machine Learning presented by Google in this YouTube video.
- Gathering Data (
dataset_generator.py
) - Preparing Data (
dataset_preparer.py
) - Choosing a Model (
model_builder.py
) - Training (
trainer.py
) - Evaluation (
trainer.py
) - Hyperparameter Tuning (
hyperparameters.py
) - Prediction (
predictor.py
)
conda install numpy scipy
pip install tensorflow tensorflow-gpu keras h5py
python trainer.py
This will first generate a dataset if none exists yet.
It will then prepare the dataset if no prepared dataset exists yet.
After that, it will build the model using the model builder
(cf. model_builder.py
) if no model exists yet.
If an existing model is found, this model will be loaded to continue its
training.
Once the prepared dataset and model are loaded, the training process is started.
N.B. Feel free to cancel the training process at any point, since it will be
possible to resume it later on by running the trainer again.
tensorboard --logdir=./logs
This will build the model using the model builder
(cf. model_builder.py
) if no model exists yet.
If an existing model is found, this model will be loaded.
Once the model is loaded, it is used to make predictions on given inputs.
python predictor.py