I've used the following code to log a metric
wandb.log({"metric": [4, 5, 6]})
but then found out that Wandb doesn't support plotting a list by default. I want to create a line plot where the y-axis is the first element of the metric array, and the x-axis is the step.
I've read the Custom Charts section of the document. I think I should use Vega to access the first element of the array. Here are the steps that I've taken: For the custom chart, I've set the data source as "history" and selected the "metric" key.
query {
runSets
(runSets: "${runSets}" ) {
id
name
history
(keys: ["metric" ] )
}
}
In the Vega script, I tried to flatten the array, using this part of the documentation
"transform": {
...
{"type": "flatten", "fields": ["${field:metric}"]},
}
This gives me a warning that "type" and "fields" arguments are not allowed, which means I should include this flattening block somewhere else (not in the transform
section).
I'm afraid I don't know where, and how I can achieve this.
Is this even possible?
If not, I think in my notebook I should write a script that accesses the wandb.run
log data, and transform the data for each run. if so, any tips for that solution is also appreciated.