Skip to content

Instantly share code, notes, and snippets.

@obeshor
Created February 20, 2021 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obeshor/a67232db4021ac10167b50a64a5c83c3 to your computer and use it in GitHub Desktop.
Save obeshor/a67232db4021ac10167b50a64a5c83c3 to your computer and use it in GitHub Desktop.
#Run a few experiments, which will take a few minutes
session_num = 0
for num_filters in HP_NUM_FILTERS.domain.values:
for dropout_rate in (HP_DROPOUT.domain.min_value, HP_DROPOUT.domain.max_value):
for activation in HP_ACTIVATION.domain.values:
for num_units in HP_NUM_UNITS.domain.values:
for optimizer in HP_OPTIMIZER.domain.values:
hparams = {
HP_NUM_FILTERS: num_filters,
HP_DROPOUT: dropout_rate,
HP_ACTIVATION: activation,
HP_NUM_UNITS: num_units,
HP_OPTIMIZER: optimizer
}
run_name = "run-%d" % session_num
print('--- Starting trial: %s' % run_name)
print({h.name: hparams[h] for h in hparams})
run('logs/hparam_tuning/' + run_name, hparams)
session_num += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment