Skip to content

Weights & Biases

Mark McDonald edited this page Jan 29, 2020 · 13 revisions

Weights & Biases is an excellent tool to support training by running a series of alternate parameters on your models and logging the results. Wandb makes it easy to fine the best parameters and recall them to train your final model with.

The project page is at https://app.wandb.ai/mcdomx/cs109b_groupproject

Install and Setup:
pip install --upgrade wandb
run = wandb login <wandb token> (visit project page and login)
run.<model parameter> = XX (e.g. run.batch_size = 64)

Include WANDB in Training Script:

import wandb
from wandb.keras import WandbCallback
wandb.init(project="cs109b_groupproject")

... model instantiation code ...

# Log metrics with wandb
model.fit(X_train, y_train, validationData=(X_test, y_test) epochs=config.epochs, callbacks=[WandbCallback()])

# Save model to wandb
model.save(os.path.join(wandb.run.dir, "model.h5"))


Execute training script as normal. Additional wandb logging entries will be displayed.
Clone this wiki locally