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

Feature Request: Different types of graphs (similar to capabilities of matplotlib) - live tracking #1020

Open
Arseni1919 opened this issue Sep 24, 2022 · 10 comments

Comments

@Arseni1919
Copy link

Hi, my name is Arseni.

I am running different ML experiments and my personal pain: I want to monitor the experiments online during the run of a script.
I like your organisation and your tools a lot, that is why I wish I could use your product more. But it seems that you are not goint to incorporate some features an time soon that super important to me and maybe important to others as well.

I would like to plot online not only ONE kind of plots as you offer - lines (!). Only line charts I can plot with you. But I want to be able to plot online MANY types of graphs: 3d plots, plt.imshow style plots, bar plots, scatter plots, pie charts and all those great tools that I see in matplotlib.

For now, the only good alternative is, as I said, Matplotlib with their strange sollution of doing plt.pause(0.01) once in a while to plot things during the run. I hope you understand what I am talking about.

You can say: Arseni, stop! We do offer you to upload different types of gfraphs.. But here is the problem: I want them to update online!! NOT to upload them at times to some supplementary folder. I do want the full functionality as your "log" functionality. To see the same graph changing as aresult of the new information comes in - scatter, 3d and others as "log" online.

That will be the great adsvantage for you.. Still no platform of your compatitors didn't do that. I hope I will able to see that feature soon.

Thank you.

@Blaizzy
Copy link
Contributor

Blaizzy commented Sep 26, 2022

I would like to plot online not only ONE kind of plots as you offer - lines (!). Only line charts I can plot with you. But I want to be able to plot online MANY types of graphs: 3d plots, plt.imshow style plots, bar plots, scatter plots, pie charts and all those great tools that I see in matplotlib.

You can do this using our integrations with the various visualization libraries (i.e., Matplotlib, plotly, bokeh, seaborn, PIL, and so on).
Docs:

Yet, as you mentioned, you want them to update online/real-time in the neptune UI. I will pass your feedback on as a feature request to the product team.
But before that, would you mind helping me understand the issue better by answering the following:

  • If I understood you correctly, you want to see an interactive graph updated as you add more 3D mesh or scatter points iteratively as the log() method does to FloatSeries values, correct? If so, what is your use case/problem you are solving that requires you to iteratively log 3D mesh or scatter points (i.e., Medical Computer Vision and so on)?
  • Why not visualize locally and then upload the final figure at the end?
  • Is this feature exclusive for 3D and scatter? or are there more types of graphs, if so, which ones exactly?

@Arseni1919
Copy link
Author

  1. Correct - I want to see live changing 3d/scatter/etc. graph as the part of "log" capabilities. I am programming algorithms for robots - with different types of graphs I can plot different statistics, positions (2d and 3d), varianses in signals, orientations, battery persentages - all of it I need to see online.
  2. Why not to visualise locally and the to upload? The answer: a great number of graphs. I cannot simply put all of desired outputs with matplotlib (I need to change layout every single time when the amount of graphs changing - Neptune completely solves this issue for me). Also, the Neptune dashboards are greate! The main idea: I do not want to wait all the way until the end (lets say 100 iterations) in order to understand that I could stop this experiment on the second iteration.
  3. The 3d and scatter are just examples. All of these are good to have: https://matplotlib.org/stable/plot_types/index.html

@Arseni1919 Arseni1919 changed the title Feature Request: Different types of graphs (like capabilities of matplotlib) Feature Request: Different types of graphs (similar to capabilities of matplotlib) - live tracking Sep 27, 2022
@Blaizzy Blaizzy self-assigned this Oct 2, 2022
@Blaizzy
Copy link
Contributor

Blaizzy commented Oct 3, 2022

Got it.

You can do that with Neptune currently by overriding the figure during your loop and to ensure you get to see it before it adds new points to the figure you can use the .wait method.

Below there is a working example that updates the figure as you specified, you can run it and to visualize the changes in the Neptune UI just refresh the page every time you want to check the latest update in case it doesn’t do it automatically.

import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display, clear_output
import neptune.new as neptune

# Create figure and subplot
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1) 

# Init Neptune run
run = neptune.init_run(…)

# Define and update plot
for i in range(100):
    x = np.linspace(0, i, 100);
    y = np.cos(x) 
    ax.set_xlim(0, i)    
    ax.cla()
    ax.plot(x, y)

    # upload figure to Neptune and override it with each new point added 
    run["fig"].upload(fig)

    # wait for all the metadata to reach Neptune servers
    run.wait()

    display(fig)    
    clear_output(wait = True)
    plt.pause(0.1)

run.stop()

Docs:

Check out this website to learn more about creating figures in a loop: https://pythonguides.com/matplotlib-update-plot-in-loop/

@Blaizzy
Copy link
Contributor

Blaizzy commented Oct 3, 2022

Let me know if this works for you

@Blaizzy
Copy link
Contributor

Blaizzy commented Oct 5, 2022

Hey @Arseni1919

Just checking checking to see if you still need help with this issue

@Arseni1919
Copy link
Author

Hi, Blaizzy.
The solution that you offered is not good for me for the reasons I mentioned ablove. I still prefer it not in a form of multiple uploaded figures (I knew about this option and it also will take more memory in an autogenerated .neptune folder), but in a form of a graph as I described. I will use regular matplotlib for now until Nuptune will incorporate at list some of other types of graphs inside their system. I still need this new feature. Did you send the request to the team already?...
Thank you in advane, Arseni.

@Arseni1919
Copy link
Author

Arseni1919 commented Oct 6, 2022

For example, instead of building some bar plot and then uploading it to the neptune, I will upload it straightaway.
Maybe it will look like this:

import numpy as np
import neptune.new as neptune

# Init Neptune run
run = neptune.init_run(…)

# Define and update plot
for i in range(100):
    x, y = new_exp_step_output()

    # upload figure to Neptune and override it with each new point added 
    run["results/bar_plot"].bar_log(y)

run.stop()

You can see how much it less code than the previous example.

@Blaizzy
Copy link
Contributor

Blaizzy commented Oct 11, 2022

I can definitely see your point, and I've flagged your comments as a feature request to our Product team and they will take it from there.

Is there anything else I can help you with at the moment? 

@Arseni1919
Copy link
Author

Waiting for the update:) Thank you!

@Blaizzy
Copy link
Contributor

Blaizzy commented Oct 12, 2022

I just spoke to the product team. They mentioned that feature you requested is definitely one we want to add to the product and it is in our backlog but currently there is no ETA on it.

I'll leave this issue open until the feature is released and also so others can see the current workaround.

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

No branches or pull requests

6 participants