Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline analysis updates for multimodal fusion. #360

Merged
merged 26 commits into from
Nov 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a7a02a8
Offline analysis updates, bug fixes
celikbasak Dec 1, 2023
2bc15db
Changelog updated
celikbasak Dec 1, 2023
bda7072
plotting updates v2
celikbasak Mar 11, 2024
03a07b2
Changes to offline analysis and gaze model, GazeEvaluator added
celikbasak May 23, 2024
88951a4
add to the ignore
tab-cmd May 23, 2024
c7d20c4
Merge branch '2.0.0rc4' into matrix_copyphrase
tab-cmd May 23, 2024
c07590b
Update to Inquiry Reshaper, comply with signal base model
tab-cmd May 23, 2024
99ddd36
Updates on gaze models - will be refactored soon
celikbasak Jul 8, 2024
a6d1a31
GP model added
celikbasak Aug 11, 2024
b04a523
changes in offline analysis
celikbasak Aug 16, 2024
040f552
updates WIP
celikbasak Aug 22, 2024
cc3933a
more updates to the model
celikbasak Aug 27, 2024
14ae79c
updates on GP
celikbasak Sep 3, 2024
477d930
updates WIP
celikbasak Sep 11, 2024
0d8dc14
changes Oct 28
celikbasak Oct 28, 2024
a497d96
Merge remote-tracking branch 'origin/2.0.0rc4' into aaai_submission_t…
tab-cmd Oct 28, 2024
77e3f07
Offline analysis updated to train and save each model separately. Pat…
celikbasak Nov 4, 2024
b0d11b1
All csv files containing results are removed
celikbasak Nov 4, 2024
3e10534
Commented out codes and TODOs removed.
celikbasak Nov 4, 2024
b693180
PR reviews resolved. Deleted unused scripts and comments
celikbasak Nov 5, 2024
18047a9
Setup.py restored, Changelog updated
celikbasak Nov 5, 2024
1f0157f
Merge branch '2.0.0rc4' into aaai_submission_tbd_later
celikbasak Nov 5, 2024
6fb6eb0
Update tests, typing
tab-cmd Nov 5, 2024
2a116a0
lint, fix remaining tests
tab-cmd Nov 5, 2024
4b457e9
remove used fusion/eval module
tab-cmd Nov 5, 2024
76cf4e7
Add some documentation and cleanup unused variable assignment
tab-cmd Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates WIP
  • Loading branch information
celikbasak committed Sep 11, 2024
commit 477d930412a40c783a140a05e252f5dce9ec0773
11 changes: 7 additions & 4 deletions bcipy/signal/model/offline_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def analyze_multimodal(eeg_data,
# we will extract the trials from the inquiries later

# define the training classes using integers, where 0=nontargets/1=targets
# erp_labels = eeg_inquiry_labels.flatten().tolist()
erp_labels = eeg_inquiry_labels.flatten().tolist()


## More gaze preprocessing:
Expand Down Expand Up @@ -509,7 +509,7 @@ def analyze_gaze(
inq_start = trigger_timing[1::11] # start of each inquiry (here we jump over prompts)

# Extract the inquiries dictionary with keys as target symbols and values as inquiry windows:
inquiries_dict, inquiries_list, labels = model.reshaper(
inquiries_dict, inquiries_list, _ = model.reshaper(
inq_start_times=inq_start,
target_symbols=target_symbols,
gaze_data=data,
Expand All @@ -518,6 +518,7 @@ def analyze_gaze(
num_stimuli_per_inquiry=10,
symbol_set=symbol_set
)


# Extract the data for each target label and each eye separately.
# Apply preprocessing:
Expand All @@ -528,10 +529,11 @@ def analyze_gaze(
continue

for j in range(len(inquiries_dict[i])):
left_eye, right_eye, left_pupil, right_pupil, deleted_samples, all_samples = extract_eye_info(inquiries_dict[i][j])
left_eye, right_eye, _, _, _, _ = extract_eye_info(inquiries_dict[i][j])
preprocessed_data[i].append((np.concatenate((left_eye.T, right_eye.T), axis=0)))
# Inquiries x All Dimensions (left_x, left_y, right_x, right_y) x Time
preprocessed_data[i] = np.array(preprocessed_data[i])
# ---------------------------------------------------------------------------

centralized_data_left = []
centralized_data_right = []
Expand Down Expand Up @@ -672,14 +674,15 @@ def analyze_gaze(

# Take the sample average of the centralized data: time_average
# centralized_data_training_set.shape = (72,4,180)

# flatten the covariance to (72, 720)
# cov_matrix = np.zeros((centralized_data_training_set.shape[0], centralized_data_training_set.shape[1]*centralized_data_training_set.shape[2]))

# for i in range(centralized_data_training_set.shape[0]):
reshaped_data = centralized_data_training_set.reshape((72,720))
cov_matrix = np.cov(reshaped_data, rowvar=False)
time_horizon = 9
# Accuracy vs time horizon

for eye_coord_0 in range(4):
for eye_coord_1 in range(4):
Expand Down