-
Notifications
You must be signed in to change notification settings - Fork 174
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
Refactor synapse delay #1536
Open
arvoelke
wants to merge
9
commits into
main
Choose a base branch
from
refactor-synapse-delay
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor synapse delay #1536
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imported the version from Scipy. This makes filters stable even with small tau.
Instead of transfer function representation. State space appears to be faster, and potentially more accurate too.
Synapse states now use signals, allowing their state to be stored for example when pickling a Simulator.
arvoelke
force-pushed
the
refactor-synapse-delay
branch
from
June 3, 2019 18:12
82d161c
to
c84f17a
Compare
drasmuss
force-pushed
the
pickleable-sim
branch
2 times, most recently
from
June 20, 2019 14:21
86a3704
to
d63d6e7
Compare
tbekolay
force-pushed
the
pickleable-sim
branch
4 times, most recently
from
July 9, 2019 22:55
3c748cd
to
99f585e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and context:
Fixes #938 by correcting the behaviour in #1535 when
D != 0
. This is accomplished by refactoring the delay in the synapse, such thaty = Cx + Du
is set at the beginning of the time-step andx = Ax + Bu
is updated at the end of the time-step.In #1535 both equations were being updated at the end of the time-step, which caused them to be applied in the wrong order in the case of
D != 0
. This implements the correct set of equations for a discrete-time LTI system, and is consistent with old behaviour whenD = 0
.Compared to the current master branch, systems that have
D != 0
andlen(A) > 0
no longer have a two time-step delay.Another improvement with this PR is the
Simulator
produces the same results as applyingfilt
, which in turn are both consistent withscipy.signal.lfilter
. This was not the case before (regardless ofD
).More details can be found here:
Interactions with other PRs:
Rebased onto #1387 (relies on having the state of the synapse being a signal), which is in turn rebased onto #1535 (state-space simulation of synapses).
How has this been tested?
Added test from #938 (comment) which now passes.
Rest of testing is a work-in-progress.
How long should this take to review?
Where should a reviewer start?
Work-in-progress.
Types of changes:
Checklist:
Still to do:
synapse=0
tosynapse=nengo.Delay()
Lowpass.filt
difference withsynapse = 0
versussynapse = nengo.Delay()
and with / withouty0 != 0
(Lowpass.filt raises shape error when tau == 0 and y0 != 0 #1590)Feedback would be helpful in determining what is worth doing.