Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to plot the each metric in a line graph? #1

Open
Ghaleb-alnakhlani opened this issue Jun 11, 2022 · 9 comments
Open

How to plot the each metric in a line graph? #1

Ghaleb-alnakhlani opened this issue Jun 11, 2022 · 9 comments

Comments

@Ghaleb-alnakhlani
Copy link

Hi,

Is it possible to plot the metric outcome into a line graph?

Thank you

@kozistr
Copy link
Owner

kozistr commented Jun 15, 2022

hello!

unfortunately, in this repo, there's no method to plot the metrics : (
but maybe you can plot the metric with libraries like matplotlib or seaborn

Thanks in advance

@Ghaleb-alnakhlani
Copy link
Author

Hi thank you for responding.

Can you please share how I can do that? If you have an example?

And just to clarify something I face some issues when I used the script. I was using google colab.
Is this correct I just need to run the python3 -m metrics and that is all?

thank you

@kozistr
Copy link
Owner

kozistr commented Jun 15, 2022

well, it depends on what you want to plot! I just attach line plot examples with code.

Hope it helps you : )

@kozistr
Copy link
Owner

kozistr commented Jun 15, 2022

sorry for the usage. final usage is like what you mentioned, python3 -m metrics. But, code isn't completed though : (

To make it works,

  1. build a real & fake (pytorch) dataloaders, like here
  2. define the metric and call it. code
    # pseudo code
    fid = FID()
    fid(real_data_loader, fake_data_loader)
    

@Ghaleb-alnakhlani
Copy link
Author

well, it depends on what you want to plot! I just attach line plot examples with code.

Hope it helps you : )

I would like to plot loss_log.txt produced by pix2pixHD training. xaxis would be the iteration and yaxis the number of epochs. and show the loss curve decreasing during the training.

@Ghaleb-alnakhlani
Copy link
Author

sorry for the usage. final usage is like what you mentioned, python3 -m metrics. But, code isn't completed though : (

To make it works,

  1. build a real & fake (pytorch) dataloaders, like here
  2. define the metric and call it. code
    # pseudo code
    fid = FID()
    fid(real_data_loader, fake_data_loader)
    

Now it make more sense. thank you for clarifying that I will make those changes and try it

@kozistr
Copy link
Owner

kozistr commented Jun 15, 2022

well, it depends on what you want to plot! I just attach line plot examples with code.
Hope it helps you : )

I would like to plot loss_log.txt produced by pix2pixHD training. xaxis would be the iteration and yaxis the number of epochs. and show the loss curve decreasing during the training.

you can code like this!

# matplotlib example, you can find more details on the matplotlib documentations
metrics = [10.2, 5.1, 2.1, 1.1, ...]
plt.plot(metrics , list(range(0, num_epochs)))

or you can use the loggers like Tensorboard, Wandb.

@Ghaleb-alnakhlani
Copy link
Author

well, it depends on what you want to plot! I just attach line plot examples with code.
Hope it helps you : )

I would like to plot loss_log.txt produced by pix2pixHD training. xaxis would be the iteration and yaxis the number of epochs. and show the loss curve decreasing during the training.

you can code like this!

# matplotlib example, you can find more details on the matplotlib documentations
metrics = [10.2, 5.1, 2.1, 1.1, ...]
plt.plot(metrics , list(range(0, num_epochs)))

or you can use the loggers like Tensorboard, Wandb.

Really can I use Tensorboard for this? I just need to upload the loss_log file. I have not tried it before and I though it was only used while training not after training is finished.

@kozistr
Copy link
Owner

kozistr commented Jun 15, 2022

oh i see! it's possible to plot with Tensorboard after the training. However, as you said, usually we use the logger to plot the metrics while training.

in your case, i guess it'd be better to use the visualization library like matplotlib : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants