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

Multiplexing multiple .observe() onto the same Watcher? #43

Open
radoye opened this issue Oct 6, 2019 · 0 comments
Open

Multiplexing multiple .observe() onto the same Watcher? #43

radoye opened this issue Oct 6, 2019 · 0 comments

Comments

@radoye
Copy link

@radoye radoye commented Oct 6, 2019

The code

I'm using a slightly modified sum_lazy.py

# create watcher object as usual
w = tw.Watcher()

weights = None
for i in range(10000):
    weights = [random.random() for _ in range(5)]

    # let watcher observe variables we have
    # this has almost no performance cost
    w.observe(weights=weights, pqr=42)
    w.observe(my_test=[-x for x in weights])
    w.observe(**{"my_testX": [-x for x in weights]})
    time.sleep(1)

and a slightly modified lazy_logging.ipynb

client = tw.WatcherClient()
#stream = client.create_stream(expr='lambda d: np.sum(d.my_test)')
stream = client.create_stream(expr='lambda d: print(d)')

Expected behavior

I'd like (expect?) different observations to be multiplexed into the stream.

Observed behavior

Only the first call to .observe() produces an event.

Singularity devX.sif:~/docks/dev/numericcal/radoye/tensorwatch/test/simple_log> python sum_lazy.py 

weights="[0.7598638948148748, 0.9609570253109472, 0.17193771268530844, 0.945312325751268, 0.8840031816567768]", pqr=42
weights="[0.9633391250000072, 0.4817883214569013, 0.5066860131563821, 0.536321656766366, 0.4866203822451308]", pqr=42
weights="[0.8682968602613323, 0.25722248154751726, 0.10094894832942802, 0.8529007560893397, 0.4847747465461011]", pqr=42
weights="[0.1920386201704245, 0.2917508358159102, 0.13423189557362525, 0.48907668597008847, 0.7810377425785467]", pqr=42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.