Homogenizing x-axis among plots

Hello WandB community,

I am having trouble doing something that I believe should be pretty straightforward. Here is the link to the Dashboard

I am training ten different splits on some data and I am logging some metrics, pretty standard stuff. Specifically I am logging some training and validation. Whenever the Validation Area Under Curve (Val AUC) surpasses the previous highest, I compute some metrics for the Test Set. After the training script is done, I download all the information in .csv files

The problem arises when comparing plots as the X-axis or Step is different for each one. For example: if we take a look at the run Pleasant-elevator-24 the highest Val AUC happens at Step 530. But the logged value of Test auc is at 530.

What I would like to have the X Steps of all the plots synced.

My code to plot this is the following:

if max_auc<metrics[0] and epoch >5:
          max_auc = metrics[0]
          torch.save(model.state_dict(), os.path.join(args.results_dir, "s_{}_{}_checkpoint.pt".format(round(metrics[0],3), cur)))
          wandb.log({"P-R curve" : wandb.plot.pr_curve(metrics[1], metrics[2], labels=['Negative', 'Positive'])})     
    
          results_dict, test_error, test_auc, acc_logger, metrics_test = summary(model, test_loader, args.n_classes)    
    
          wandb.log({"P-R curve test" : wandb.plot.pr_curve(metrics_test[1], metrics_test[2], labels=['Negative', 'Positive'])})   
          wandb.log({'Test auc' : metrics_test[0], 
                  'Test bal acc' : metrics_test[3],
                  'Test sensitivity': metrics_test[4],
                          'Test specificity': metrics_test[5]})

Is there a way in which I can solve this issue without having to re-run the experiments again?

Maybe I am getting something wrong here, I appreciate all the help!

Hi @carloshernandezp,

If not set manually, step automatically increments every time .log is called. There are 2 ways you can synchronize your step value, though both of them require the experiment to be re-run:

  1. Any metrics logged in a single call to log will be considered part of that step.
  2. You can also set the step metric manually as wandb.log(..., step=step). Please note that in this case, you are controlling step manually and must make sure that step increases monotonically. Any decreases in the value of step will cause the value of .log to be ignored.

Unfortunately, this also means that there is no way to adjust the axes of your chart, and you will have to create new experiments.

You can read a more comprehensive explanation here.

Thanks,
Ramit

Thank you very much for your answer.

As I was logging the test metrics 3 wandb.log(...) later I found a workaround by simply adding 3 units on the downloaded .csv files. Which for all intended purposes, worked just fine.

I will be extra careful next time.

Thank you once again.