Skip to content

Loihi neuron type nengo_dl builders not used by default #248

@hunse

Description

@hunse

nengo_loihi.builder.nengo_dl has the builders for nengo_dl for LoihiLIF and LoihiSpikingRectifiedLinear.

If you make a nengo_loihi.Simulator and tensorflow is installed, these builders will get properly initialized (see the install_dl_builders) call in Simulator.__init__. However, if you just import these neuron types from nengo_loihi to do training in nengo_dl, before you've created a nengo_loihi.Simulator, the builders won't be initialized.

Even worse, these neuron types are subclasses of LIF and SpikingRectifiedLinear that nengo_dl does know how to build, so it just ends up silently trying to build them but not working.

I think that these builders should be initialized as soon as the neuron types are imported from nengo_loihi.neurons. Then, things will just work as people expect. This is what we had originally, but then we changed it for some reason, and I can't remember why. (@tbekolay, you're a co-author with me on that commit 025cdf9. Do you remember why?)

If for some reason we can't guarantee that the builders will be initialized, then I think we need some way to throw an error if someone tries to use those neuron types in nengo_dl (and that error can point the user to how to initialize them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions