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

Support opting in to spikes on the forward pass #208

Open
arvoelke opened this issue Feb 26, 2021 · 0 comments
Open

Support opting in to spikes on the forward pass #208

arvoelke opened this issue Feb 26, 2021 · 0 comments

Comments

@arvoelke
Copy link
Contributor

arvoelke commented Feb 26, 2021

Currently there isn't an easily accessible or documented way to train with spikes on the forward pass. It seems like it can be done by patching in your own builder method that overrides the training_step for each neuron model that is being used. This isn't thoroughly tested but it seems to work (e.g., for the nengo.StochasticSpiking wrapper in Nengo 3.1.0):

from nengo_dl import compat
from nengo_dl.neuron_builders import SimNeuronsBuilder, StochasticSpikingBuilder

class CustomStochasticSpikingBuilder(StochasticSpikingBuilder):

    def training_step(self, J, dt):
        return self.step(J, dt)


SimNeuronsBuilder.TF_NEURON_IMPL[compat.StochasticSpiking] = CustomStochasticSpikingBuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant