Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SoaresLMB authored Jul 11, 2024
1 parent de1ab35 commit 4f4981c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions builders/data_training_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ def generate_array_of_other_activities(data_array_acc, data_array_gyr, array_siz
collected data files. Used inside a "for" loop in the "generate_activities" function.
"""
def create_data_sets_for_training(position, activity, magacc, xacc, yacc, zacc, maggyr, xgyr, ygyr, zgyr,
list_of_data_arrays_in_the_time_domain, list_of_data_arrays_in_the_frequency_domain,
labels_list):
list_of_data_arrays_in_the_time_domain, list_of_data_arrays_in_the_frequency_domain,labels_list):

multiple_class_label_1, multiple_class_label_2, binary_class_label_1, binary_class_label_2 = create_labels(activity)

activity = activity.split("_with_rifle")[0]

five_second_activity_list = ["FALL_1", "FALL_2","FALL_3","FALL_5","FALL_6","ADL_5","ADL_6","ADL_7","ADL_8","ADL_15"]
transition_activities_list = ["OM_3", "OM_4", "OM_5","OM_6", "OM_7", "OM_8"]

multiple_class_label_1,multiple_class_label_2,binary_class_label_1,binary_class_label_2 = create_labels(activity)


array_size = 1020 if position == "CHEST" else 450

Expand Down
2 changes: 1 addition & 1 deletion builders/model_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def objective(trial,input_shape,X_train,y_train,X_val,y_val,neural_network_type,
def create_study_object(objective, input_shape, X_train, y_train, X_val, y_val, neural_network_type,neural_network_results_dir,number_of_labels):
study = optuna.create_study(direction="maximize")

study.optimize(lambda trial: objective(trial, input_shape, X_train, y_train, X_val, y_val, neural_network_type,neural_network_results_dir,number_of_labels), n_trials=100)
study.optimize(lambda trial: objective(trial, input_shape, X_train, y_train, X_val, y_val, neural_network_type,neural_network_results_dir,number_of_labels), n_trials=3)

best_trial = study.best_trial
best_params = best_trial.params
Expand Down

0 comments on commit 4f4981c

Please sign in to comment.