@@ -115,8 +115,11 @@ def objective(trial: optuna.Trial) -> float:
115115 num_lateral_connection_tries_per_unit = trial .suggest_int ('num_lateral_connection_tries_per_unit' , 10 , 35 )
116116
117117 learning_rate = trial .suggest_float ('learning_rate' , 0.003 , 0.006 ) # log=True)
118+ # phase_i_b_learning_rate = trial.suggest_float('learning_rate', 0.0001, 0.006)
119+
118120
119121 epochs = trial .suggest_int ('epochs' , 50 , 75 )
122+ phase_i_b_epochs = trial .suggest_int ('epochs' , 50 , 150 )
120123
121124 batch_size = 5 # trial.suggest_int('batch_size', 5, 10)
122125
@@ -1372,19 +1375,22 @@ def create_dataset(raw_text_sample, tokenizer, sample_expansion_batch_size=10) -
13721375 phase_i_b_dataset = create_dataset (raw_text_sample = phase_i_b_samples , tokenizer , sample_expansion_batch_size = 10 )
13731376
13741377 # To Do: Set .fit() params <------<<<
1375-
1378+
1379+
13761380 phase_i_b_history = \
13771381 best_model_found .fit (
13781382 x = phase_i_b_dataset ,
1379- epochs = epochs ,
1383+ epochs = phase_i_b_epochs ,
13801384 batch_size = batch_size ,
13811385 validation_split = 0.2 )
13821386
13831387 phase_i_b_history = \
13841388 pd .DataFrame (phase_i_b_history .history )
1385- # To Do: Find best metric: Reference: cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py: Line ~ 590
1386- # result = phase_i_b_history.
1389+ # To Do: Find best metric: Reference: cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py: Line ~ 590
1390+ # = phase_i_b_history.
1391+ result = int (phase_i_b_history ['perplexity' ].min ())
13871392
1393+
13881394 return result
13891395
13901396def main ():
0 commit comments