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

Reset op resets to initial signal value #1652

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tbekolay
Copy link
Member

Motivation and context:
When I was preparing the 3.1 release, I found that a slow test was failing. To fix it, I added a Reset op, which required resetting the value to a two-dimensional value instead of a scalar. Rather than deal with that, I though it made more sense to have Reset reset signals to their initial values, whatever they may be.

In the end, I went with another approach to fix the slow test failure, but this PR still seems like a useful one to have IMO.

How has this been tested?
Existing tests cover it.

How long should this take to review?

  • Quick (less than 40 lines changed or changes are straightforward)

Types of changes:

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the CONTRIBUTING.rst document.
  • I have updated the documentation accordingly.
  • I have included a changelog entry.
  • [na] I have added tests to cover my changes.
  • I have run the test suite locally and all tests passed.

Still to do:

  • Discuss if this change is worthwhile
  • Add changelog entry

@hunse
Copy link
Collaborator

hunse commented Dec 8, 2021

One downside to this for a backend like NengoOCL is it means we'll have to either store all the arrays of initial values on the GPU, or copy them over each timestep. Neither seems ideal.

I'd probably suggest a hybrid approach where for Reset ops that are resetting the whole signal to the same value, we specify that value (e.g. Reset(sig, value=0)), but we also allow for a way to reset to initial value in the case where we need that (e.g. Reset(sig, value=None) or something like that).

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

Successfully merging this pull request may close these issues.

None yet

2 participants