BasisResearch / collab-creatures

Analyzing animal collaboration with Bayesian and causal inference.
4 stars 1 forks source link

Random birds pipeline (simulation -> transformation -> inference) #2

Closed rfl-urbaniak closed 11 months ago

rfl-urbaniak commented 12 months ago

Best to pull first, then through the notebook (in random_hungry_followers/docs) before reviewing the code in detail. random_birds.py includes a rough proposal for the design format for various simulations. It's pretty basic. Let me know what you think, this is obviously open to revisions. Also, in the spirit of using the GitHub workflow, I'm doing this as a pull request assigning Emily and Marjorie as reviewers. Either comment and request modifications (and then we discuss & revise), or approve and then merge.

rfl-urbaniak commented 12 months ago

added the full pipeline with transformations and inference for random birds, start with rhf_docs and going over the two notebooks that are in there.

rfl-urbaniak commented 11 months ago

Refactored the simulation, now random birds get assigned to self.random_birds and move to self.birds only if you wish so, with additional bird type tracking in the trace. Opens the possibility of adding multiple bird types with different batch sizes in the same simulation. Refactored reward updating to start at a particular time, so that if we really care about respawning rewards at a given point, updating can refresh from that point.

emackev commented 11 months ago

Don't quite understand what you mean by moving self.random_birds to self.birds, is there an example in the code I could look at?

rfl-urbaniak commented 11 months ago

Don't quite understand what you mean by moving self.random_birds to self.birds, is there an example in the code I could look at?

Notice now the RandomBirds class is an instance of Birds class. Birds when run will only generate self.random_birds, but not self.birds - this is because random birds play a double role: random birds themselves (as you have seen), but also just placeholders in the process of generating other simulations - you'll see how this works when I'm done with the hungry birds, and I'll be happy to explain what I had in mind.