Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper function to initialize LIF state #156

Merged
merged 9 commits into from
Dec 20, 2018
Merged

Helper function to initialize LIF state #156

merged 9 commits into from
Dec 20, 2018

Conversation

arvoelke
Copy link
Owner

@arvoelke arvoelke commented Dec 4, 2018

Related to nengo/nengo#1415.

This adds a helper function that can be used as follows:

from nengolib.neurons import init_lif

# ... build model containing ensemble x ...

with nengo.Simulator(model) as sim:
    init_lif(sim, x)

    # ... run model ...

to initialize the state of the LIF ensemble x by sampling the steady-state solution given the zero vector as input. This is mathematically equivalent to fast-forwarding in time (to after the mixing time of the stochastic process, and after any subthreshold neurons have stabilized at v = J), which solves the problem of the start of the simulation having some initial transient / degenerate state.

It also takes into account the tuning curves (e.g., for thresholding ensembles), and supports initializing at values other than 0, including higher-dimensions.

TODO:

  • Document this with sphinx example
  • Document this in CHANGES.rst
  • More comprehensive testing with assertions

nengolib/neurons.py Outdated Show resolved Hide resolved
nengolib/neurons.py Outdated Show resolved Hide resolved
nengolib/neurons.py Outdated Show resolved Hide resolved
@arvoelke
Copy link
Owner Author

arvoelke commented Dec 5, 2018

Test failing due to pytest upgrade while old tests are using older version of nengo. nengo/nengo@9e8f363#diff-b5e89441c0e97432af7158d317237833. Thinking I should use an older version of pytest for the Nengo versions prior to nengo/nengo#1443.

Repository owner deleted a comment from codecov-io Dec 19, 2018
Repository owner deleted a comment from codecov-io Dec 19, 2018
@codecov-io
Copy link

codecov-io commented Dec 19, 2018

Codecov Report

Merging #156 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #156   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          29     30    +1     
  Lines        1398   1431   +33     
  Branches      162    165    +3     
=====================================
+ Hits         1398   1431   +33
Impacted Files Coverage Δ
nengolib/compat.py 100% <ø> (ø) ⬆️
nengolib/signal/system.py 100% <ø> (ø) ⬆️
nengolib/neurons.py 100% <100%> (ø) ⬆️
nengolib/temporal.py 100% <100%> (ø) ⬆️
nengolib/testing.py 100% <100%> (ø)

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 293492c...c529239. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants