pjullrich/machine-learning-project
Machine Learning Project
Setting up
Data
- Copy the
paintings.zipfromGoogle Driveinto theProject folder - Extract the
paintings.zipfile. - Delete the
paintings.zipfile.
Dev Environment
- Install
Python 3.6.3 - Open a Terminal in your
Project Folder - Create a Virtual Environment with
python3 -m venv ./venv - Activate the Virtual Environment with
source venv/bin/activate - Install the requirements with
pip install -r requirements.txt
Keras
- Run
training.pyonce. At first it won't work since Keras is not yet configured, but this will create a.kerasfolder in$HOME - Open the file
.keras/keras.jsonin your Home directory. - Change the
backendentry to 'theano'. - Change the
image_data_formatentry tochannels_first - Save and exit the file.
- Now, you should be able to run
training.pywithout errors!
Configuring the CNN
- All configurations can be made in
config.py. I pushed the ones that are most interesting to the top of the file. - The layers of the CNN can be changed in
cnn.py. Make sure that the Flatten() layer is always the last one.
Running the CNN
- Run the
training.pyscript. This script trains and validates the CNN.
Resources
https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html https://keras.io/ https://github.com/inejc/painters/blob/master/painters/train_cnn.py https://www.wga.hu/index1.html