Commit 52ee98d7 authored by Ard Kastrati's avatar Ard Kastrati
Browse files

Revert "Integrated InceptionTime, created the structure of the project....

Revert "Integrated InceptionTime, created the structure of the project. InceptionTime is not finished."

This reverts commit 2f7d6ddb.
parent 2f7d6ddb
File deleted
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 2.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
This diff is collapsed.
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/GitLab.iml" filepath="$PROJECT_DIR$/.idea/GitLab.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Inception/InceptionTime" vcs="Git" />
<mapping directory="$PROJECT_DIR$/InceptionTime" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -39,7 +39,7 @@ def run(trainX, trainY):
train(trainloader=trainloader, net=net, optimizer=optimizer, criterion=criterion)
# save our trained model
PATH = '../cifar_net.pth'
PATH = './cifar_net.pth'
torch.save(net.state_dict(), PATH)
def train(trainloader, net, optimizer, criterion, epoch=50):
......@@ -60,7 +60,7 @@ def train(trainloader, net, optimizer, criterion, epoch=50):
# print statistics
running_loss += loss.item()
if i % 200 == 0: # print every 200 mini-batches
if i % 200 == 0: # print every 2000 mini-batches
print('[%d, %5d] loss: %.3f' %
(epoch + 1, i + 1, running_loss / 200))
running_loss = 0.0
......
def run():
print "test"
\ No newline at end of file
......@@ -28,7 +28,7 @@ def torch_data(data_path, filename, variable1, variable2, verbose=True, detailed
:param data_path: name of the file to open.
:param verbose: boolean; if true, it prints information about
the status of the program.
:return: a numpy array of shape ...?0
:return: a numpy array of shape ...?
"""
if verbose: print("Loading data... ")
if verbose: print("Extracting trials...")
......@@ -36,7 +36,7 @@ def torch_data(data_path, filename, variable1, variable2, verbose=True, detailed
if verbose: print(len(trials), " trials found.")
full_data = np.array([])
for i in range(20):
for i in range(len(trials)):
if detailed_verbose: print("Trying trial", trials[i])
try:
next_trial = load_matlab_trial(datapath=data_path, trial=trials[i], filename=filename, variable1=variable1,
......@@ -75,7 +75,7 @@ def load_matlab_trial(datapath, trial, filename, variable1, variable2):
data = np.swapaxes(data, 0, 2)
data = np.swapaxes(data, 1, 2)
else:
data = data - 1 # y needs to be 0 or 1 (instead of 1 and 2)
data = data - 1 # data needs to be between 0 and 1
return data
......@@ -89,4 +89,4 @@ def extract_trials():
print "Server unreachable. Cannot list the directories. Did you (maybe) forget to connect to the server by VPN? Is your root directory set correctly in config.py file? :)"
raise Exception
trials = [name for name in my_list if len(name) == 3]
return trials
return trials
\ No newline at end of file
InceptionTime @ 470ce144
Subproject commit 470ce144c1ba43b421e72e1d216105db272e513f
......@@ -2,21 +2,17 @@
# let's keep it here to have a clean code on other methods that we try
general_params = {}
CNN_params = {}
InceptionTime_params = {}
"""
Models:
CNN-1: First try: CNN to predict movement towards left or right (prosaccade) with 1 second data.
InceptionTime: The InceptionTime baseline
EEGNet: The other baseline
DeepEye: Our method
RNN? Transformers, Attention, etc etc
"""
# general parameters
general_params['model'] = "InceptionTime"
general_params['model'] = "CNN-1"
general_params['data_path'] = "/Volumes/methlab/ETH_AS/preprocessed2/"
general_params['root_dir'] = "."
# CNN - 1
CNN_params['trainX_variable1'] = "EEGprocue"
......@@ -25,14 +21,4 @@ CNN_params['trainX_filename'] = "EEGprocue"
CNN_params['trainY_variable1'] = "trialinfopro"
CNN_params['trainY_variable2'] = "cues"
CNN_params['trainY_filename'] = "trialinfocuelocked"
# InceptionTime
InceptionTime_params['trainX_variable1'] = "EEGprocue"
InceptionTime_params['trainX_variable2'] = "data"
InceptionTime_params['trainX_filename'] = "EEGprocue"
InceptionTime_params['trainY_variable1'] = "trialinfopro"
InceptionTime_params['trainY_variable2'] = "cues"
InceptionTime_params['trainY_filename'] = "trialinfocuelocked"
\ No newline at end of file
CNN_params['trainY_filename'] = "trialinfocuelocked"
\ No newline at end of file
File deleted
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment