"# Experiment Tracking Tutorial: Weights and Biases\n",
"\n",
"Weights and Biases (W&B, [wandb.ai](wandb.ai)) is a machine learning platform for developers to quickly track experiments, visualize results, reproduce models and a lot more. The general concept is to have a platform where you can live track your machine learning trainings and store your models/configurations without having to manage the database by yourself."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Sign Up\n",
"\n",
"You have to sign up first in order to use W&B. Go to [wandb.ai/site](wandb.ai/site) and create a **personal** account. Personal accounts can be used for as many experiments as you like and are free of charge. \n",
"Additionally, you have to install the W&B library as a python package. You can do this by running the following command:\n",
"\n",
"`pip install wandb`\n",
"\n",
"We have already installed it for you here.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Login\n",
"\n",
"To use W&B in your experiments, you need to be logged in on the machine you are running your experiments on. You can either do this in a jupyter notebook/python script by running the following cell and putting in your API key, which you can find [here](https://wandb.ai/authorize):"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Failed to detect the name of this notebook, you can set it manually with the WANDB_NOTEBOOK_NAME environment variable to enable code saving.\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33mihaide\u001b[0m. Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n"
]
},
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import wandb\n",
"wandb.login()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you want to log in in a terminal so you don't have to repeat this step every time you run an experiment, you can run the following command and enter your API key after setting up your python environment:\n",
"\n",
"`wandb login`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initialize a Run\n",
"\n",
"You can initialize a run in W&B, adding it to an existing project or creating a new one, as well as adding a config file to this run which tracks the hyperparameters of your experiment and will be stored in the database. You can do this by running the following cell:"
# Experiment Tracking Tutorial: Weights and Biases
Weights and Biases (W&B, [wandb.ai](wandb.ai)) is a machine learning platform for developers to quickly track experiments, visualize results, reproduce models and a lot more. The general concept is to have a platform where you can live track your machine learning trainings and store your models/configurations without having to manage the database by yourself.
%% Cell type:markdown id: tags:
## Sign Up
You have to sign up first in order to use W&B. Go to [wandb.ai/site](wandb.ai/site) and create a **personal** account. Personal accounts can be used for as many experiments as you like and are free of charge.
Additionally, you have to install the W&B library as a python package. You can do this by running the following command:
`pip install wandb`
We have already installed it for you here.
%% Cell type:markdown id: tags:
## Login
To use W&B in your experiments, you need to be logged in on the machine you are running your experiments on. You can either do this in a jupyter notebook/python script by running the following cell and putting in your API key, which you can find [here](https://wandb.ai/authorize):
%% Cell type:code id: tags:
``` python
importwandb
wandb.login()
```
%% Output
Failed to detect the name of this notebook, you can set it manually with the WANDB_NOTEBOOK_NAME environment variable to enable code saving.
[34m[1mwandb[0m: Currently logged in as: [33mihaide[0m. Use [1m`wandb login --relogin`[0m to force relogin
True
%% Cell type:markdown id: tags:
If you want to log in in a terminal so you don't have to repeat this step every time you run an experiment, you can run the following command and enter your API key after setting up your python environment:
`wandb login`
%% Cell type:markdown id: tags:
## Initialize a Run
You can initialize a run in W&B, adding it to an existing project or creating a new one, as well as adding a config file to this run which tracks the hyperparameters of your experiment and will be stored in the database. You can do this by running the following cell:
%% Cell type:markdown id: tags:
run = wandb.init(project="intro_wandb", config={"learning_rate": 0.01})