Custom plot: numerical derivative

In W&B is it possible to plot something like a numerical derivative?
ie plot something like: loss_{i-1} - loss_i
I’m trying to define like a “plateau rate” curve to help me see if something is getting close to converging.

Alternatively , is there some notion of “time” which can be used to define a numerical derivative?
ie can I do something like ${loss@_step-1} or ${loss:_step-1}

Hi @vchiley , happy to help. You could:

  1. Attempt to add a custom expression to on of your charts,
  2. Perform any custom calculations offline and log them to wandb via wandb.log()
  3. As wandb custom charts are built over Vega, you could log your data then generate a custom chart where within the vega spec perform custom calculations

Yes this gets to the heart of my question: how would I create a custom expression where I can do something like ${loss @ _step-1} - ${loss @ _step}? is there some notion of “measure at step index”?

Hi @vchiley , the “Expressions” input will evaluate to a numeric value per logged step. While the “X Axis Expression” input will rescale your axis. You can’t specifically evaluate expressions at specific step values. For more control I would recommend either performing custom calculations prior to logging metrics, or using a custom vega calculation