qewton.optim.tuner.results package

Module contents

Submodules

qewton.optim.tuner.results.analyzer module

qewton.optim.tuner.results.tune_results module

class qewton.optim.tuner.results.tune_results.TrainResult(params: dict, train_state: TrainerState | None = None)[source]

Bases: object

A class to store the results of a training process.

params

The parameters used for training.

Type:

dict

score

The score achieved with these parameters.

Type:

float

params: dict
train_state: TrainerState | None = None
class qewton.optim.tuner.results.tune_results.TuneResultCollector(save_path='tuning_results', save_interval=10)[source]

Bases: object

A class to store and save the results of a tuning process.

file_names = {'csv': 'results.csv', 'json': 'setup.json'}
termination_key = 'Termination Reason'
time_key = 'Training Time [s]'
save_key = 'Save Path'
hp_key = 'Hyperparameters'
hp_type_key = 'Hyperparameter Types'
objective_names_key = 'Objective Names'
objective_values_key = 'Objective'
current_results: list[TrainResult]
hp_dag: HyperParameterDAG
param_names: list[str]
tuning_objectives: list[Constraint]
objective_names: list[str]
csv_path: str
csv_columns: list[str]
cb_keys: list[str]
cb_objectives: list[None | str]
set_hp_and_conditions(hp_dag: HyperParameterDAG, tuning_objectives: list[Constraint])[source]

Set the hyperparameter DAG and tuning objectives for the collector.

Parameters:
  • hp_dag (HyperParameterDAG) – The hyperparameter DAG.

  • tuning_objectives (list) – The list of tuning objectives.

add_callback_info(train_state: TrainerState)[source]

Add callback information from the training state to the collector.

Parameters:

train_state (TrainerState) – The training state containing callback info.

add_result(new_result: TrainResult)[source]

Add a new result to the collector.

Parameters:

new_result (TrainResult) – The new result to be added.

finish_tuning()[source]

Finalizes the tuning process by saving any remaining results.

save_results()[source]

Writes the results of a batch of trials to the CSV file.

setup_file_tree()[source]

Sets up the files for logging tuning results