tuning ¶
CLI module for running raytune tuning experiment.
Functions:
-
load_data_config_from_path
–Load the data config from a path.
-
tune
–Run model hyperparameter tuning.
load_data_config_from_path ¶
Load the data config from a path.
Parameters:
-
data_path
(str
) –Path to the input data file.
-
data_config_path
(str
) –Path to the data config file.
-
split
(int
) –Split index to use (0=train, 1=validation, 2=test).
Returns:
-
Dataset
–A TorchDataset with the configured data.
Source code in src/stimulus/cli/tuning.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
tune ¶
tune(
data_path: str,
model_path: str,
data_config_path: str,
model_config_path: str,
optuna_results_dirpath: str = "./optuna_results",
best_model_path: str = "best_model.safetensors",
best_optimizer_path: str = "best_optimizer.pt",
) -> None
Run model hyperparameter tuning.
Parameters:
-
data_path
(str
) –Path to input data file.
-
model_path
(str
) –Path to model file.
-
data_config_path
(str
) –Path to data config file.
-
model_config_path
(str
) –Path to model config file.
-
optuna_results_dirpath
(str
, default:'./optuna_results'
) –Directory for optuna results.
-
best_model_path
(str
, default:'best_model.safetensors'
) –Path to write the best model to.
-
best_optimizer_path
(str
, default:'best_optimizer.pt'
) –Path to write the best optimizer to.
Source code in src/stimulus/cli/tuning.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|