Using sweep for a metric that was logged in a nested way

In my training code, I logged my test loss and accuracy in a nested way like the following

wandb.log({"test":{"loss":test_loss, "accuracy":test_acc}})

When using sweep, I want to use the test loss as the metric to optimize like the following

sweep_config = {
    "method": "random",
    "metric": {"name": "test.loss",
                "goal": "minimize"},

Is it possible to use a metric that was logged in a nested way or should I change the my way of logging?

Hi @hlee2745 , the nested approach is currently support. As long as the tracked metric is logged within your runs, the sweeps will track that value. Please let us know if you have any questions.

Thanks for the reply:)
I’m just wondering what I should use for the “name” of the metric in sweep_config. Since the test loss was logged in a nested way during training, it was not given an explicit name. So would using the name “test.loss” be fine?
Btw, I chose the name “test.loss” bc. it was the name of the chart for the test loss in wandb UI.

I have the same question, and an answer would be appreciated.
More specifically, I have logged my metrics like this: wandb.log({"my label":{"f1-score": f1, "accuracy": acc}}), so I’m wondering how to deal with the space and dash in key names, when specifying metric to improve. Is the following accepted?
sweep_config = { "metric": {"name": "my label.f1-score", "goal": "maximize"},...