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

Is there near plan to add more documents? #44

Closed
ypxie opened this issue Mar 26, 2017 · 4 comments
Closed

Is there near plan to add more documents? #44

ypxie opened this issue Mar 26, 2017 · 4 comments

Comments

@ypxie
Copy link

ypxie commented Mar 26, 2017

Great tools!
and I have several questions.
how to create different visdom workspace programmingly?
Is it possible to make the following code work if the window 'loss' has not been initiated before. It's quite inconvenient if I have to create every window first using some dammy data and then update it.

viz.line(
    X = np.asarray([0]),
    Y= np.array([10]),
    win='loss',
    update='append'
)

Thank you~

@ypxie ypxie changed the title Is there any plan to add More documents? Is there near plan to add more documents? Mar 26, 2017
@lvdmaaten
Copy link
Contributor

lvdmaaten commented Mar 26, 2017

The win does not need to exist when you specify it. What do you need dummy data for? A code setup like this should work just fine:

win = None
for n in range(N):
   data = #...
   win = viz.plot(X=data, win=win)

This code pattern is used in this Lua example: https://github.com/facebookresearch/visdom/blob/master/example/demo2.lua#L99-109

@ypxie
Copy link
Author

ypxie commented Mar 26, 2017

Thank you for your reply.
But in my case, I'd prefer win be a pre-specified 'string', because later I need to get access to the same figure in another place. If I use None as Win, it seems that it will return a very complex string rather than a meaningful one. I used the following workaround, but there should be a better one.

    win = name + '_loss'
    res = plot.line(
            X = steps,
            Y=  values,
            win= win,
            update='append'
        )
    if res != win:
        plot.line(
            X = steps,
            Y=  values,
            win=win
        )

Fot the line-plot, is there anyway to get access to the data (X, Y) stored in the figure? Because when I re-run a program, the index start from 1 again, but I want to append it to the end of the figure, rather than creating a new figure.
Thank you!

@lvdmaaten
Copy link
Contributor

You can use a pre-specified win string:

vis = visdom.Visdom()
win = visdom.text{text = 'test', win = 'my_window'}
print(win)

This will print 'my_window'.

There is currently no way to access the data on the server from the Python/Lua wrapper, but you can use the update='append' option to add new data to the existing data.

@ypxie
Copy link
Author

ypxie commented Mar 26, 2017

Thank you for your answering.
For example, I have already many pairs of (x,y) in a plot.
But then I re-load my program and want to append new data points to the end of that plot.
But the current x will start from 1 again and I don't actually know how many points in the original plot. so It will be hard to append to the right place.
Thank you~

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