hnn-core
hnn-core copied to clipboard
Optimize rhythmic drives
The goals are:
- To be able to optimize parameters associated with rhythmic drives. The user sets the frequency bands and relative bandpower. In the example below, we wish to optimize power in the 9-11 Hz and 19-21 Hz bands in a ratio of 1 to 2 (i.e. twice as much power in the beta band as in the alpha band).
optim = Optimizer(net, tstop=tstop, constraints=constraints,
set_params=set_params, obj_fun='maximize_psd')
optim.fit(f_bands=[(9, 11), (19, 21)], relative_bandpower=(1, 2), scale_factor=scale_factor,
smooth_window_len=smooth_window_len)
Example output
Reversing the ratios
optim.fit(f_bands=[(9, 11), (19, 21)], relative_bandpower=(2, 1), scale_factor=scale_factor,
smooth_window_len=smooth_window_len)
- To allow the user to define
obj_fun
as a callable.
Codecov Report
Attention: Patch coverage is 80.72289%
with 16 lines
in your changes are missing coverage. Please review.
Project coverage is 92.55%. Comparing base (
54ddd40
) to head (78ab67d
). Report is 49 commits behind head on master.
:exclamation: Current head 78ab67d differs from pull request most recent head d046764. Consider uploading reports for the commit d046764 to get more accurate results
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #673 +/- ##
==========================================
- Coverage 92.66% 92.55% -0.12%
==========================================
Files 27 27
Lines 4911 4945 +34
==========================================
+ Hits 4551 4577 +26
- Misses 360 368 +8
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
can you share what the example outputs in the PR description?
can you share what the example outputs in the PR description?
Updated! I'm not getting the expected ratios (1:2, α:β) so I'm looking into that now.
whatever happened to this PR ? Was this close to merge? Is this something this year's GSoC student can work on?
whatever happened to this PR ? Was this close to merge? Is this something this year's GSoC student can work on?
Hi, I'm going to work on getting this merged but I think it's definitely something this year's GSoC student can expand on.
@carolinafernandezp you seem to have rebase conflicts ... might be easiest to create a new branch from latest master, cherry pick your commits on to that branch, rename that branch to optimize_rhythmic
and force push.
The build is failing because of the GUI example ... @gtdang @kmilo9999 how best to address this? maybe we could separate the GUI examples into a separate build using Github actions?
We can just get rid of those GUI docs from the build. New docs for the GUI will just be markdown to reduce the complexity and fragility of the notebook builds.
How do we guarantee that the examples will run as expected for the user? unit tests?
How do we guarantee that the examples will run as expected for the user? unit tests?
Exactly this, after going through the numerous problems with rendering the GUI tutorials, having hand-made tutorials with less extensive testing seems like the better option than having absolutely no tutorials due to an updated package
alright, go for it ... please remove it so we can move ahead with @carolinafernandezp 's PR
@carolinafernandezp we've finally fixed the documentation issues, if you have the bandwidth in the next week or so would you want to do a quick zoom call to rebase this together and go ahead and merge it?
Also note for myself to close #176 once this is merged
Sounds great @ntolley, how is Thursday the 18th? Any time would work for me
Just tested this locally and everything is running great, thanks a bunch @carolinafernandezp this is a super useful contribution!!
Thanks @ntolley and everyone that helped!👏🏻