Commit 963a2464 authored by Shreyan Chowdhury's avatar Shreyan Chowdhury
Browse files

bug fix

parent 333e9359
......@@ -12,16 +12,27 @@ model_config = {
}
initialized = False # TODO: Find a better way to do this
trial_counter = 0
def run(hparams):
global initialized, trial_counter
trial_counter += 1
if not initialized:
init_experiment(comment=hparams.experiment_name)
from utils import CURR_RUN_PATH, logger # import these after init_experiment
logger.info(f"tensorboard --logdir={CURR_RUN_PATH}")
if not initialized:
logger.info(f"tensorboard --logdir={CURR_RUN_PATH}")
initialized = True
trial_name = f"trial_{trial_counter}"
logger.info(trial_name)
logger.info(hparams)
exp = Experiment(save_dir=CURR_RUN_PATH)
exp = Experiment(name=trial_name, save_dir=CURR_RUN_PATH)
# exp.tag(hparams)
# callbacks
early_stop = EarlyStopping(
......@@ -32,11 +43,11 @@ def run(hparams):
)
checkpoint_callback = ModelCheckpoint(
filepath=os.path.join(CURR_RUN_PATH, 'best.ckpt'),
filepath=os.path.join(CURR_RUN_PATH, trial_name, 'best.ckpt'),
save_best_only=True,
verbose=True,
monitor='val_loss',
mode='min'
monitor='prauc',
mode='max'
)
if USE_GPU:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment