|
| 1 | +# AE1d |
| 2 | +This is the implementation of "Autoencoder" corresponding to 1-dimensional shape.<br> |
| 3 | +Original paper: G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 2006. [link](https://science.sciencemag.org/content/313/5786/504.abstract) |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +### 1. Build |
| 8 | +Please build the source file according to the procedure. |
| 9 | +~~~ |
| 10 | +$ mkdir build |
| 11 | +$ cd build |
| 12 | +$ cmake .. |
| 13 | +$ make -j4 |
| 14 | +$ cd .. |
| 15 | +~~~ |
| 16 | + |
| 17 | +### 2. Dataset Setting |
| 18 | + |
| 19 | +#### Recommendation |
| 20 | +- Normal Distribution Dataset<br> |
| 21 | +This is the dataset of 300-dimensional data of 1-dimensional shape that has a training set of 100,000 pieces and a test set of 1,000 pieces.<br> |
| 22 | +Link: [official](https://github.com/koba-jon/normal_distribution_dataset) |
| 23 | + |
| 24 | +- THE MNIST DATABASE of handwritten digits<br> |
| 25 | +This is the dataset of 28x28 grayscale for handwritten digits in 10 classes that has a training set of 60000 images and a test set of 10000 images.<br> |
| 26 | +Link: [official](http://yann.lecun.com/exdb/mnist/) |
| 27 | + |
| 28 | +#### Setting |
| 29 | + |
| 30 | +Please create a link for the dataset.<br> |
| 31 | +The following hierarchical relationships are recommended. |
| 32 | + |
| 33 | +~~~ |
| 34 | +datasets |
| 35 | +|--Dataset1 |
| 36 | +| |--train |
| 37 | +| | |--data1.dat |
| 38 | +| | |--data2.csv |
| 39 | +| | |--data3.txt |
| 40 | +| | |
| 41 | +| |--valid |
| 42 | +| |--test |
| 43 | +| |
| 44 | +|--Dataset2 |
| 45 | +|--Dataset3 |
| 46 | +~~~ |
| 47 | + |
| 48 | +You should substitute the path of training data for "<training_path>", test data for "<test_path>", respectively.<br> |
| 49 | +The following is an example for "NormalDistribution". |
| 50 | +~~~ |
| 51 | +$ cd datasets |
| 52 | +$ git clone https://github.com/koba-jon/normal_distribution_dataset.git |
| 53 | +$ ln -s normal_distribution_dataset/NormalDistribution ./NormalDistribution |
| 54 | +$ cd .. |
| 55 | +~~~ |
| 56 | + |
| 57 | +### 3. Training |
| 58 | + |
| 59 | +#### Setting |
| 60 | +Please set the shell for executable file. |
| 61 | +~~~ |
| 62 | +$ vi scripts/train.sh |
| 63 | +~~~ |
| 64 | +The following is an example of the training phase.<br> |
| 65 | +If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument. |
| 66 | +~~~ |
| 67 | +#!/bin/bash |
| 68 | +
|
| 69 | +DATA='NormalDistribution' |
| 70 | +
|
| 71 | +./AE1d \ |
| 72 | + --train true \ |
| 73 | + --epochs 300 \ |
| 74 | + --dataset ${DATA} \ |
| 75 | + --nd 300 \ |
| 76 | + --nz 1 \ |
| 77 | + --batch_size 64 \ |
| 78 | + --gpu_id 0 |
| 79 | +~~~ |
| 80 | + |
| 81 | +#### Run |
| 82 | +Please execute the following to start the program. |
| 83 | +~~~ |
| 84 | +$ sh scripts/train.sh |
| 85 | +~~~ |
| 86 | + |
| 87 | +### 4. Test |
| 88 | + |
| 89 | +#### Setting |
| 90 | +Please set the shell for executable file. |
| 91 | +~~~ |
| 92 | +$ vi scripts/test.sh |
| 93 | +~~~ |
| 94 | +The following is an example of the test phase.<br> |
| 95 | +If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument. |
| 96 | +~~~ |
| 97 | +#!/bin/bash |
| 98 | +
|
| 99 | +DATA='NormalDistribution' |
| 100 | +
|
| 101 | +./AE1d \ |
| 102 | + --test true \ |
| 103 | + --dataset ${DATA} \ |
| 104 | + --test_in_dir "test" \ |
| 105 | + --test_out_dir "test" \ |
| 106 | + --nd 300 \ |
| 107 | + --nz 1 \ |
| 108 | + --gpu_id 0 |
| 109 | +~~~ |
| 110 | +If you want to test the reconstruction error of the data, the above settings will work.<br> |
| 111 | +If you want to test the denoising of the data, set "test_in_dir" to "directory of noisy data" and "test_out_dir" to "directory of output ground truth".<br> |
| 112 | +However, the two file names must correspond. |
| 113 | + |
| 114 | +#### Run |
| 115 | +Please execute the following to start the program. |
| 116 | +~~~ |
| 117 | +$ sh scripts/test.sh |
| 118 | +~~~ |
| 119 | + |
0 commit comments