Skip to content

Commit e0c5aeb

Browse files
authored
Merge pull request #378 from donglihe-hub/hp_search
Remove Redundant merge_train_val
2 parents 12519d0 + deeec96 commit e0c5aeb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

search_params.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,11 @@ def prepare_retrain_config(best_config, best_log_dir, retrain):
171171
best_config.merge_train_val = False
172172

173173

174-
def load_static_data(config, merge_train_val=False):
174+
def load_static_data(config):
175175
"""Preload static data once for multiple trials.
176176
177177
Args:
178178
config (AttributeDict): Config of the experiment.
179-
merge_train_val (bool, optional): Whether to merge the training and validation data.
180-
Defaults to False.
181179
182180
Returns:
183181
dict: A dict of static data containing datasets, classes, and word_dict.
@@ -187,7 +185,7 @@ def load_static_data(config, merge_train_val=False):
187185
test_data=config.test_file,
188186
val_data=config.val_file,
189187
val_size=config.val_size,
190-
merge_train_val=merge_train_val,
188+
merge_train_val=config.merge_train_val,
191189
tokenize_text="lm_weight" not in config.network_config,
192190
remove_no_label_data=config.remove_no_label_data,
193191
)
@@ -231,7 +229,7 @@ def retrain_best_model(exp_name, best_config, best_log_dir, retrain):
231229
with open(os.path.join(checkpoint_dir, "params.yml"), "w") as fp:
232230
yaml.dump(dict(best_config), fp)
233231

234-
data = load_static_data(best_config, merge_train_val=best_config.merge_train_val)
232+
data = load_static_data(best_config)
235233

236234
if retrain:
237235
logging.info(f"Re-training with best config: \n{best_config}")

0 commit comments

Comments
 (0)