Commit ab6cbb46 authored by Ard Kastrati's avatar Ard Kastrati
Browse files

Tested IOHelper for merging

parent b8d5e7de
......@@ -32,24 +32,23 @@ def store(x, y, clip=True):
pickle.dump(y, output_y)
output_y.close()
def store_data(verbose=True):
def collect_data(verbose=True):
"""
Load the data for training.
:param datapath: matlab data directory
:param variable: variable of the matlab file
:return: the data as numpy array
"""
train_x = collect_data(data_path=config['data_path'], filename=config['cnn']['trainX_filename'],
train_x = collect_trial_data(data_path=config['data_dir'], filename=config['cnn']['trainX_filename'],
variable1=config['cnn']['trainX_variable1'], variable2=config['cnn']['trainX_variable2'],
verbose=verbose, detailed_verbose=True)
train_y = collect_data(data_path=config['data_path'], filename=config['cnn']['trainY_filename'],
train_y = collect_trial_data(data_path=config['data_dir'], filename=config['cnn']['trainY_filename'],
variable1=config['cnn']['trainY_variable1'], variable2=config['cnn']['trainY_variable2'],
verbose=verbose, detailed_verbose=True)
return train_x, train_y
def collect_data(data_path, filename, variable1, variable2, verbose=True, detailed_verbose=False):
def collect_trial_data(data_path, filename, variable1, variable2, verbose=True, detailed_verbose=False):
"""
Extract data from the file.
:param data_path: name of the file to open.
......@@ -57,6 +56,7 @@ def collect_data(data_path, filename, variable1, variable2, verbose=True, detail
the status of the program.
:return: a numpy array of shape ...?0
"""
if verbose: print("Loading data... ")
if verbose: print("Extracting trials...")
trials = extract_trials()
......@@ -107,7 +107,7 @@ def extract_trials():
Extracts the trials from the root directory
"""
try:
my_list = os.listdir(params['data_path'])
my_list = os.listdir(config['data_dir'])
except:
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
......
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