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

Improve experiment management #403

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions src_py/apiServer/apiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,22 @@ def run_current_experiment_phase(self):


def next_experiment_phase(self):
"""
Returns - None if noe more experiments
next phase type (training or prediction)
"""
current_exp_flow = globe.experiment_focused_on
events_sync_inst = current_exp_flow.get_events_sync()
events_sync_inst.reset() # preparing for next phase
current_exp_flow.current_exp_phase_index += 1
if not self.experiment_phase_is_valid():
LOG_WARNING("No more phases to run")
self.next_expertiment_phase_exist = False
return None
else:
self.next_expertiment_phase_exist = True
next_phase_type = self.current_exp.get_current_experiment_phase().get_phase_type()
return next_phase_type

def communication_stats(self):
assert self.experiment_phase_is_valid(), "No valid experiment phase"
Expand Down
2 changes: 1 addition & 1 deletion src_py/apiServer/apiServerHelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
======== Running experiment ==========
-experiment_phase_is_valid() returns True if there are more experiment phases to run
-run_current_experiment_phase() runs the current experiment phase
-next_experiment_phase() moves to the next experiment phase
-next_experiment_phase() moves to the next experiment phase and returns the phase type

======== Retrieving statistics ======
-get_experiment_flow(experiment_name).generate_stats() returns statistics object (E.g., assigned to StatsInst) class for the current experiment phase
Expand Down
17 changes: 1 addition & 16 deletions src_py/apiServer/experiment_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ def __init__(self ,experiment_name, batch_size_dc: int, network_componenets: Net
self.exp_flow_json = None
self.events_sync_inst = EventSync()

# def next_experiment_phase(self):
# self.current_exp_phase_index += 1
# if self.current_exp_phase_index >= len(self.exp_phase_list) - 1:
# return False
# return True

def get_current_experiment_phase(self):
def get_current_experiment_phase(self) -> ExperimentPhase:
assert self.current_exp_phase_index < len(self.exp_phase_list) , "current experiment phase index is out of range"
return self.exp_phase_list[self.current_exp_phase_index]

Expand Down Expand Up @@ -125,15 +119,6 @@ def parse_experiment_flow_json(self, json_path : str, override_csv_path = ""):
self.add_phase(phase_name, phase_type, source_pieces_inst_list, num_of_features)


def generate_experiment_flow_skeleton(self):
# Todo check with david if we need this function
# for user to fill in the details
experimentName = ""
batch_size = 0
csv_file_path = ""
num_of_features = 0
num_of_labels = 0

def set_csv_dataset(self, csv_file_path : str, num_of_features : int, num_of_labels : int, headers_row : list):
self.csv_dataset = CsvDataSet(csv_file_path, self.temp_data_path ,self.batch_size, num_of_features, num_of_labels, headers_row) # Todo get num of features and labels from csv file

Expand Down