Simple implementation of AutoEncoder, which is one of the deep learning algorithms. This is implemented based on framework Tensorflow.
This project consists of three programs.
- AutoEncoder.py
Main program of this project, and this is the imeplementation of AutoEncoder. - Trainer.py
Sample program to run training. It requires training data images, and will be described below for details. - Predictor.py
Sample program to prediction by using trained data. It requires trained parameter data and input for prediction. This will also be described below.
Python class which has training and prediction functions of AutoEncoder.
This class is implemented based on framework Tensorflow.
TODO:to be written about more technical details.
This implementation requires CSV file listing 2 image file paths in each row as learning data. File of the first column path is input for AutoEncoder, and the second column is file path of training data image. CSV is necessary because batch data read function of Tensorflow needs it. This repository include sample csv, dataList.csv, and image files as samples.
Currently, this implementation has some limitations.
- Treat only 1-dimensional image (e.g. gray scale image). There is a plan to extend it to treat 3-dimensional image (e.g. RGB color image).
- Data images have to be 512x512 pixels size._
TODO:to be written
While learning, the implementation output the status of learning as below.
Running part will write learning progress like below.
Step: 600, Loss: 90405240.000000 @ 2017/05/12 08:50:08
This consists of 3parts:
- Step value of learning process
- Loss value, which is sequare sum of pixel value differences between predicted values and teacher values
- Timestamp when the progress is output
Default implementation of running parts write progress at the first step and every 200 steps after the first step.
TODO:to be written
AutoEncoder.py outputs files for Tensor Board in board directory.
You can see Tensor Board by Tensorflow's usual way to invoke it.
TODO:to be written for more details.
Trainer.py saves files of session files, which includes trained parameters at the saving step.
These files are saved in saved_session directory.
Trainer.py can load them to resume training from saved step.
Predictor.py loads them to predict image by using trained parameters at saved step.
Sample implementation of training by using AutoEncoder.py. This implementation use data from dataList.csv.
TODO:to be written about more technical details.
Sample implementation of prediction by using AutoEncoder.py. This implementation use data from predictList.csv.
TODO:to be written about more technical details.
- Please run AutoEncoder.py, and class definition is loaded.
- Please run Trainer.py. This program load training data and output session data of Tensorflow for every 200 training steps.
- Please modify settings in Predictor.py, and run. This program load session data and output predicted image by matplotlib.
To run, libraries as stated below in Requirements is necessary.
- Python3, Tensorflow 1.1.0, and the libraries it requires.
- Trainer.py and Predictor.py require matplotlib to draw predicted images.