Skip to content

MultiModel continue run - #182

Merged
caglorithm merged 6 commits into
masterfrom
feature/multimodel_continue_run
Aug 9, 2021
Merged

caglorithm merged 6 commits into
masterfrom
feature/multimodel_continue_run

Conversation

@jajcayn

@jajcayn jajcayn commented Aug 6, 2021

Copy link
Copy Markdown
Collaborator

MultiModel now able to accommodate continuous runs with model.run(continue_run=True). It'll set initial state from previous run(s).
Naturally, one can change parameters between runs, and, moreover, one can also change (noise) inputs in between runs.
E.g. one can start the ALN model with no noise for 2 seconds, then continue with Ornstein-Uhlenbeck and finally end it with sinusoidal input. Of course, one can change parameters in between.

Moreover, one last addition: some shortcuts for ease of access:
model.num_state_variables - return total number of state variables in the MultiModel
model.num_noise_variables - return the total number of variables that accept noise (e.g. in ALN node it's 2)
model.noise_input - return or set the full input to the model (list of length num_noise_variables)

Therefore, changing (noise) inputs for MultiModel was never easier:

mm = MultiModel(...)
# list of `Input` classes of the same length as original list, i.e. mm.num_noise_variables
mm.noise_input = [stim.ZeroInput(), stim.OrnsteinUhlenback(...), ...]
# set all to the same input
mm.noise_input = [stim.ZeroInput()] * mm.num_noise_variables
# or change just one
mm.noise_input[1] = stim.ZeroInput()

@jajcayn jajcayn linked an issue Aug 6, 2021 that may be closed by this pull request
4 tasks done
@codecov

codecov Bot commented Aug 6, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #182 (42e58c2) into master (696b099) will increase coverage by 0.03%.
The diff coverage is 95.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage   94.96%   94.99%   +0.03%     
==========================================
  Files          50       50              
  Lines        4308     4351      +43     
==========================================
+ Hits         4091     4133      +42     
- Misses        217      218       +1     
Flag Coverage Δ
unittests 94.99% <95.92%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
neurolib/models/multimodel/builder/base/backend.py 99.27% <89.47%> (-0.73%) ⬇️
neurolib/models/multimodel/model.py 92.47% <100.00%> (+2.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 696b099...42e58c2. Read the comment docs.

@caglorithm

Copy link
Copy Markdown
Member

LGTM, merging if you're ready!

@jajcayn

jajcayn commented Aug 9, 2021

Copy link
Copy Markdown
Collaborator Author

I was born ready

@caglorithm

Copy link
Copy Markdown
Member

https://gfycat.com/leftshadyindianspinyloach

git merge

@caglorithm
caglorithm merged commit fea81d6 into master Aug 9, 2021
@jajcayn
jajcayn deleted the feature/multimodel_continue_run branch August 9, 2021 10:04
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

Successfully merging this pull request may close these issues.

Allow continue_run for MultiModel

2 participants