Skip to content

Instantly share code, notes, and snippets.

@icoxfog417
Last active June 10, 2019 03:51
Show Gist options
  • Save icoxfog417/99c183b2464c4a10777459454be5417c to your computer and use it in GitHub Desktop.
Save icoxfog417/99c183b2464c4a10777459454be5417c to your computer and use it in GitHub Desktop.
allennlp_tutorial_tuner.py
hyperparameter_ranges = {
"lr": ContinuousParameter(0.01, 0.1),
"embedding-dim": CategoricalParameter([6, 12]),
"hidden-dim": CategoricalParameter([6, 12])
}
objective_metric_name = "validation loss"
objective_type = "Minimize"
metric_definitions = [
{"Name": objective_metric_name,
"Regex": "validation_loss=([0-9\\.]+)"}
]
tuner = HyperparameterTuner(estimator,
objective_metric_name,
hyperparameter_ranges,
metric_definitions,
max_jobs=3,
max_parallel_jobs=1,
objective_type=objective_type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment