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

WIP: Add live analysis #325

Closed
wants to merge 3 commits into from
Closed

WIP: Add live analysis #325

wants to merge 3 commits into from

Conversation

JammyL
Copy link
Contributor

@JammyL JammyL commented May 2, 2023

This is very hacky - just showing how something like this could look.

Code needs tidying and removing a bunch of copy pastes!

Add LiveAnalysis

This is similar to DefaultAnalysis, but with a stripped back implementation to handle only reading result channels and pushing to other datasets

Adds LiveAnalysisRunner, which handles the live_analysis passed from ExpFragment.get_live_analyses
The required CustomAnalysis classes are determined at build time through similar filters

A change that is worth discussion, at run time the dataset_prefix is passed from the TopLevelRunner to the fragment. This allows the fragment to access datasets at run time which is very useful for the live analysis.

Most of the changes to Fragment stem from the ScanRunner not having access to the TopLevelRunner. For the DefaultAnalysis this is run after the ScanRunner is done and so isn't an issue.

We could pass the TopLevelRunner as an argument to ScanRunner.run and then call the live_analysis on TopLevelRunner.

Alternatively (and perhaps most sensibly) we pass the LiveAnalysis objects down to the ScanRunner and have ScanRunner handle them. - Have done this through the LiveAnalysisRunner

Of course, this is all assuming we want to stick with a model roughly like the LiveAnalysis

@JammyL JammyL marked this pull request as draft May 2, 2023 16:07
JammyL added 2 commits May 3, 2023 11:37
LiveAnalysis can be handled by Default/CustomAnalysis
move make_value_dict and make_coordinate_dict to utils
@JammyL
Copy link
Contributor Author

JammyL commented May 3, 2023

This currently breaks subscans - I need to pass the result channel sinks to the scanrunner in the subscan implementation.
However, we're currently considering how to change this anyway with on-kernel subscans

@hartytp
Copy link
Contributor

hartytp commented May 3, 2023

Could you provide a bit of background about what problem you're looking to solve here?

@JammyL
Copy link
Contributor Author

JammyL commented May 3, 2023

Could you provide a bit of background about what problem you're looking to solve here?

Sure, I think this has been burried in some private conversations, so definitely worth explaining here too.
I've implenented an ndscan-ified version of our RBM scripts in our experiment specific repository. The current implenetation of this is a 2D scan over no_cliffords and seed (for generating a random sequence). These then run in a random order. I then average over the results from different seed values at each no_cliffords after each data point is taken and push to another dataset.
Then another plot can subscribe to these datasets.

An alternative to the above would be to do a series of subscans, but this lacks random order that a 2D scan can provide, and so visualising a RBM run would be slow

This PR is to provide a place for discussion at how this kind of repeated analysis could look to enable such an experiment.
A possible extra usecase I think we could work into this is gettting live plots for subscans so we don't have to wait until the end of each point.

@hartytp
Copy link
Contributor

hartytp commented May 3, 2023

Thanks for explaining!

@dnadlinger
Copy link
Member

Closing, with our internal design notes now at #388, #389, #390.

@dnadlinger dnadlinger closed this Apr 21, 2024
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

Successfully merging this pull request may close these issues.

3 participants