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

Tutorial part 3 #38

Open
franknoe opened this issue Mar 24, 2017 · 0 comments
Open

Tutorial part 3 #38

franknoe opened this issue Mar 24, 2017 · 0 comments

Comments

@franknoe
Copy link
Collaborator

franknoe commented Mar 24, 2017

This refers to
https://github.com/markovmodel/adaptivemd/blob/master/examples/tutorial/3_example_adaptive.ipynb
While I'm working through the notebook, some of the questions / comments refer to the framework in general. Apologies if I am making comments or asking questions that have been addressed elsewhere.

  • General: The main thing I'd like to understand in this notebook is how to write an adaptive sampling script in general. For that I would need to be able to write the strategy function in such a way that I can access all relevant information from the database (model or statistics computed from the stored trajectories) in order to make a decision. So let's say I want to implement simulated annealing through the framework, i.e. whenever running a trajectory, I want to restart from the last frame of the previous trajectory, and I want to select the temperature to run at using a Monte-Carlo step that employs the potential energy and the temperature of the last frame. In order to implement that I guess we would need to store these quantities in the database after the run (how do we do that in principle?), and then access them from the strategy function (how do we access the project/database from here?). In general, these two essential aspects are not clear from the tutorials. They do not necessarily be in the tutorials, but should be extensively explained in the docs.

  • Cell 4: <StoredBundle for with 222 file(s) @ 0x11443ab50>. Why "for with" and what does the number in the end mean?

  • Cell 4: "Now restore our old ways to generate tasks" - what does that mean?

  • Cell 6: I would replace the call to map by a list comprehension as it's more widely known and map isn't very commonly used.

  • Cell 6: Puh, this needs more explanation. It's key to understand this function and how to use it. I think I have a very rough idea, but I'm still not very clear. So let's see:

    • At first, I had the impression that this function would need a specific set of parameters and I was trying to find an API documentation that describes how to write it. I couldn't find that - now I have the impression that you can write whatever you want here (and with any list of parameters), but I'm not sure. So let's first describe who is calling this function when, in order to understand where it is placed in the control flow. Again a pictorial description of the control flow in the docs with an indication where this function is called and what it does would help.
    • What I find most curious is that this function refers to project, engine and modeler, but these are defined outside the function. In a Jupyter notebook this will work, because variables are global, but how is this supposed to work in general? Of course it would be extremely important to be able to refer to the project inside this function such that you can compute whatever is needed in order to make the decision (unless you call a standard function). So how do we access these things in general? I guess passing a reference to the project to the function is probably a useful way to do this, because from there we can (hopefully) access all quantities needed.
    • What do the yield statements do? I have to confess I've never used yield. I was aware that yield is something like a return used in generators, e.g. see here: http://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do-in-python. However in your function yield appears to cause the process to wait until the subsequent expression is true (that's also what you write in the text). I couldn't find a documentation of yield which does that. Maybe this behavior is a side effect but it seems to me that this is not the conventional use of python yield. Please clarify. If the functionality can be implemented differently, I think that would be preferable, because I guess I'm not the only person who will be confused here.
    • Nomenclature. What exactly is an event in this framework? In my understanding an event is something that happens, so why can you add an event to a project? Maybe you mean that you add an event listener or a function that react to events instead?
    • Nomenclature. I have no clue what that FunctionalEvent could mean. Again, maybe you mean a function that responds to certain events - and if so what kind of events?
    • project.add_event(strategy(loops=2)). I don't understand what happens here. You add this strategy function to the project and set the loops variable to 2 (so you run two adaptive loops with 4 workers per loop I guess). But why does add_event get a strategy? Why isn't is add_strategy? Maybe it's a terminology problem.
  • Cell 7: The note says something about RP (radical-pilot), but I guess the package doesn't use RP anymore or at least not by default, so this is confusing.

  • Cell 9 : what does while project._events: do? What does it mean if an event is True or False?

  • Cell 10: Now it reads like adding an event is basicly submitting a (macro)job or adaptive sampling job that consists of a pack of microjobs that are concerted on the computing resource. If that is what you mean by event, why not call it macrojob or something similar that is clearly understandable.

  • The rest of the notebook is really unclear, but it also seems unfinished, so I'm going to stop here for now.

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

1 participant