To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

README.md 2.56 KB
Newer Older
Ard Kastrati's avatar
Ard Kastrati committed
1
2
# DL-Project

zpgeng's avatar
zpgeng committed
3
Predicting eye gaze direction with DL
zigeng's avatar
zigeng committed
4
	
zigeng's avatar
zigeng committed
5
Models that we try: CNN, InceptionTime, EEGNet, Xception, DeepEye, and DeepEyeRNN.
6
7


zpgeng's avatar
zpgeng committed
8
9
10
11
12
13
## Datasets

 - 125Hz data: noweEEG.mat
 - 500Hz data: all_EEGprocuesan.mat
 - labels (0 for left, 1 for right): all_trialinfoprosan.mat

zpgeng's avatar
zpgeng committed
14
15
16
17
18
19
20
21
22
23
24
## Model Configuration

Please configure the config.py file correctly before running the main.py file:   
  
config['data_dir']    : indicates the directory where you stored the data  
config['model']       : indicates the model you want to use, choose between 'cnn', 'eegnet', 'inception', 'xception' or'deepeye'  
config['downsampled'] : True if you want to use 125 data points per second instead of 500. Default is False  
config['split']       : True if you want to run a clustered version of the model, please keep it to False as the clustered version is inneficient  


## Parameter Tuning
zpgeng's avatar
zpgeng committed
25
26
27

Please find the files which are related to our model:
	
zpgeng's avatar
zpgeng committed
28
29
30
31
32
33
34
35
	|
	| - CNN -- CNN.py
	| - DeepEye -- deepeye.py
	| - DeepEyeRNN -- deepeyeRNN.py
	| - EEGNet -- eegNet.py
	| - InceptionTime -- inception.py
	| - Xception -- xception.py
	| - ConvNet.py
zpgeng's avatar
zpgeng committed
36

zpgeng's avatar
zpgeng committed
37
38
39
You can find the architechture of our models in these files. For `CNN`, `DeepEye`, `DeepEyeRNN`, `InceptionTime`, and `Xception`, you should tune the parameter by looking into the `ConvNet.py` file and adjust the parameters (e.g. `self.nb_filter`) accordingly.

For `EEGNet` model, you should directly look into the `eegNet.py` file and tune the parameters accordingly.
zpgeng's avatar
zpgeng committed
40
41
42
43
44
45


## Running in the Cluster

For [ETH Leonhard](https://scicomp.ethz.ch/wiki/Python_on_Leonhard) users, you can follow these steps:
	
zpgeng's avatar
zpgeng committed
46
	1. Please use the command `module load gcc/6.3.0 python_gpu/3.8.5 hdf5/1.10.1` before training the model.
zpgeng's avatar
zpgeng committed
47
	
zpgeng's avatar
zpgeng committed
48
	2. Edit the _data directory_ and __run directory__ where you _saved the datasets_ and __run the code for saving the logs and outputs__.
zpgeng's avatar
zpgeng committed
49
50
	
	3. Use the following command to run the model: `bsub -n 10 -W 4:00 -o experiment_[your_model] -R "rusage[mem=5000, ngpus_excl_p=1]" python ../main.py`
zpgeng's avatar
zpgeng committed
51

zpgeng's avatar
zpgeng committed
52
53
__Note:__  If you want to run the model locally, you should ensure to have Pytorch, Tensorflow==2.x installed.
	   
zpgeng's avatar
zpgeng committed
54

zpgeng's avatar
zpgeng committed
55
56
57
58
59
60
61
## Reading the Results

A summary of the model is printed in the `experiment_[your_model]` file generated by the Leonhard cluster.

After each run, a directory with the name `'number'_config['model']` is created under the run directory, where 'number' refers to the time stamp of the training (different for each run of main.py). It contains the weights of the model, a .csv file with the fiting history, the best validation score and an accuracy and loss plot of the training.