AllenNeuralDynamics / dynamic-foraging-task

Bonsai/Harp workflow for Dynamic Foraging with Python GUI for visualization and control
MIT License
5 stars 4 forks source link

Add indicator for |bias| > 0.7 #296

Open alexpiet opened 6 months ago

alexpiet commented 6 months ago

Steps:

alexpiet commented 1 week ago

@hanhou Can you provide @micahwoodard a definition of how to compute bias online?

alexpiet commented 1 week ago

These two issues might be redundant: I think this issue is one method for computing bias: https://github.com/AllenNeuralDynamics/aind-behavior-blog/issues/314

I think the resolution of this issue is to compute bias, and remove the matching plot: https://github.com/AllenNeuralDynamics/aind-behavior-blog/issues/313

hanhou commented 1 week ago

As discussed here, we think we can try two biases, naive bias and logistic regression bias (and remove the old matching bias). But if we choose only one, I would prefer the logistic regression bias, for reasons mentioned earlier in that thread.

@micahwoodard

micahwoodard commented 1 week ago

@alexpiet @hanhou the issue says calculate bias online. Are there instances of online calculations elsewhere in the repo or other places? I have not done that before so example code or direction would be helpful

alexpiet commented 1 week ago

@micahwoodard By "online" we mean after each trial in the GUI as opposed to calculating the bias "offline" after the session is over. So you will just use a normal function in the code repo that executes either in the main thread, or in a separate thread if its slow.

micahwoodard commented 1 week ago

Ohhhhhh okay thank you for that clarification

micahwoodard commented 5 days ago

@alexpiet @hanhou Do you want me to import the logistic regression bias functions in the aind-foraging-behavior-bonsai or just implement the functionality within the foraging repo? I see the the logistic regression function linked takes a nwb file as an argument, and I see that there is a TrasferToNWB py file within the foraging repo, but I'm not seeing where a nwb file is generated or used. Is the idea to generate a nwb based on the GenerateTrials class and then feed that into the logistic regression bias function?

alexpiet commented 5 days ago

@micahwoodard We want to implement the functionality into the task repo.

TransfertoNWB.py is going to be removed soon.

micahwoodard commented 5 days ago

Okay that makes sense. In the logistic regression bias function, it seems like it cycles through different models from different papers found here. Are we going with a particular model?

alexpiet commented 5 days ago

I defer to @hanhou on this topic

hanhou commented 5 days ago

Let's use Su2022. See this comparison: https://github.com/AllenNeuralDynamics/aind-dynamic-foraging-models?tab=readme-ov-file#comparison

micahwoodard commented 4 days ago

@hanhou Do you have an idea what values we should use for the logistic regression function? Right now I am just using all the defaults, but would love input on values to use.

hanhou commented 4 days ago

I haven't systematically explored the parameters but I think the default values should be fine.