Skip to main content

WANDB Demo

Demo of WANDB with a toy MNIST example and image segmentation applications
Created on February 5|Last edited on March 17

Sweep report

Here is the report for my sweep


Parameter importance with respect to
Loss/total_val

Config parameter
Importance
Correlation
Loading...
Run set
120

The change I made to the code:
import model
import AwesomeNewBlock

model.add(AwesomeNewBlock)
The awesome equation behind the code change:
l(θ)i=1MEQi(zi)[logpθ(xizi)]DKL(Qi(zixi)p(zi))l(\theta) \geq \sum_{i=1}^M{\mathbb{E}_{Q_i(z_i)}[log{p_{\theta}(x_i | z_i)}] – D_{KL}(Q_i(z_i | x_i) || p(z_i))}





Setup

Library and account

Quickstart page : https://docs.wandb.ai/quickstart

  • Install library image.png
  • Create account and login:

    image.png

  • If .git in project directory: automatically saves commit for each run

    image.png

    Script integration

  • Initialize and HPP

    image.png

  • Specify project. Project is automatically created if it doesn't exist

  • Natively handles HPP: no need to use another library like argparse

  • Log metrics
    • Log and specify epoch image.png
    • Log once per epoch image.png

Results : image.png

  • Log images

    • Monitor model as it is training
    • Create visualizations from the WANDB UI



Run set
0

  • Log model graph, parameters and gradients

    image.png

see example : https://wandb.ai/lucas_p/wandb-demo/runs/007hgoi8?workspace=user-lucas_p



Sweeps

WANDB lets you run sweeps to search for the best HPP

Setup

WANDB will automatically analyze your runs and come up with a proposal for a set of HPP to explore.

Specify the search strategy, parameter distributions, early stopping (optional) in a .yaml file

image.png



Initialize the sweep, and you a provided with a sweep ID

image.png

Replace your usual "python3 train.py" by the provided command

image.png

--count 1 : if not specified, the agent will keep starting new runs each time one finishes.
With SLURM : simply start how many runs you want with --count 1

Results

https://wandb.ai/lucas_p/wandb-demo/sweeps/la5c3f2r?workspace=user-lucas_p

image.png

Image segmentation



Code

image.png

then simply
to_log["mask_img"] = mask_img
wandb.log(to_log)

Results




Run set
0




  • Log images
    • Monitor model as it is training
    • Create visualizations from the WANDB UI



Run set
0

  • Log model graph, parameters and gradients
    


Sweeps

WANDB lets you run sweeps to search for the best HPP

Setup

WANDB will automatically analyze your runs and come up with a proposal for a set of HPP to explore.
Specify the search strategy, parameter distributions, early stopping (optional) in a .yaml file



Initialize the sweep, and you a provided with a sweep ID


Replace your usual "python3 train.py" by the provided command


--count 1 : if not specified, the agent will keep starting new runs each time one finishes.With SLURM : simply start how many runs you want with --count 1

Results





Image segmentation



Code




then simplyto_log["mask_img"] = mask_imgwandb.log(to_log)

Results




Run set
0