add bayesian sampling results for tuning
"cell_type": "markdown",
"metadata": {},
"source": [
- "**Note: You can try with `--bert_model':'bert-base-uncased`to run a smaller bert model faster.**"
+ "**Note: You can try with `--bert_model:'bert-base-uncased'`to run a smaller bert model faster.**"
]
},
{
"metadata": {},
"source": [
"### 3.1 Start a hyperparameter sweep\n",
- "First, we will define the hyperparameter space to sweep over. In this example we will use random sampling to try different configuration sets of hyperparameter to minimize our primary metric, the f1 score (`f1`). For simplicity, we tune the BERT base model with `--bert_model':'bert-base-uncased` and `node_count=1`."
+ "First, we will define the hyperparameter space to sweep over. In this example we will use random sampling to try different configuration sets of hyperparameter to minimize our primary metric, the f1 score (`f1`). For simplicity, we tune the BERT base model with `--bert_model':'bert-base-uncased` and `node_count=1`.\n",
+ "\n",
+ "We can also try with `BayesianParameterSampling` with suggested `max_total_runs=20`.\n",
+ "```Python\n",
+ "param_sampling = BayesianParameterSampling( {\n",
+ " 'learning_rate': uniform(5e-5, 9e-5),\n",
+ " }\n",
+ ")\n",
+ "```"
]
},
{
"outputs": [],
"source": [
"# start the HyperDrive run\n",
- "hyperdrive_run = experiment.submit(hyperdrive_config)"
+ "hyperdrive_run = experiment.submit(hyperdrive_config)\n",
+ "RunDetails(hyperdrive_run).show()"
]
},
{
"metadata": {},
"source": [
"### 3.3 Find and register the best model\n",
- "Once all the runs complete, we can find the run that produced the model with the highest F1 score. The F1 score with default learning rate is **86.18** in [Submit and Monitor your run](#2.6-Submit-and-Monitor-your-run) . The best F1 score is **87.01** after tuning with `learning rate=0.000090`."
+ "Once all the runs complete, we can find the run that produced the model with the highest F1 score. The F1 score with default learning rate is **86.18** in [Submit and Monitor your run](#2.6-Submit-and-Monitor-your-run) . The best F1 score is **87.01** after tuning with `learning rate=0.000090` with random sampling. With Bayesian sampling, the best F1 score is **86.87** after tuning with `learning rate=0.0000896`."
]
},
{
