jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
55 stars 52 forks source link

optimization with specific within-drive params fixed #660

Closed darcywaller closed 3 months ago

darcywaller commented 1 year ago

Hi all, as I have been using the optimize_evoked() function in hnn-core, I have been missing the ability to uncheck and thereby "fix" certain parameters for evoked drives (i.e., like timing or a specific synaptic weight) while optimizing other params, which was an option available in the old GUI optimization dashboard.

I understand that the "which_drives" input allows for only optimizing specific drives, but it would be nice to be able to be more granular about which params for which drives are optimized.

jasmainak commented 1 year ago

you read our mind! It is upcoming in @carolinafernandezp 's PR #652 ... unfortunately, specific parameters might be a little hard to extract in optimize_evoked unless you or someone here has an idea how to do it easily.

rythorpe commented 1 year ago

If you're interested in hacking it in the short term, here is an example of how to optimize a specific subset of the parameters for a poisson drive. This example is a perhaps a bit convoluted because I'm using a custom cost function based on mean population spike rates, so let me know if you'd like to meet to chat more about this.

darcywaller commented 1 year ago

Awesome! Glad to hear it is in the works. I agree that it didn't look like a simple hack from what is already in the function code, but I will check out Ryan's example code - thanks!

ntolley commented 3 months ago

@darcywaller you should checkout the new optimization examples (soon to be released with v0.4), I think you can achieve the optimization functionality you're looking for

Feel free to open if it doesn't solve your problem!