nengo-dl
nengo-dl copied to clipboard
Support/examples for converting or embedding Keras RNNs
Related:
- https://github.com/nengo/nengo-dl/issues/122
- https://github.com/nengo/keras-spiking/issues/13
In order to get a Keras RNN to work inside of NengoDL one needs to use a work-around where time is removed from the Nengo model (https://github.com/nengo/nengo-dl/issues/122#issuecomment-568023159) which currently isn't a documented solution. It's also not a general solution, for instance, if one wants to integrate this with other Nengo models. As a use case, suppose I want to take a keras_lmu.LMUCell
and then hook it up to a Nengo subnetwork to filter and process the outputs of the RNN one step at a time. One could rewrite the keras_lmu.LMUCell
using Nengo primitives, as in the NengoDL LMU example. But I'm suspecting it might be possible to embed the LMUCell
within a TensorNode
and call it one step at a time, or something similar. If so an example of this would be especially nice so that there is some support for this sort of use case.
It's not currently possible to use an RNN cell inside a TensorNode (because you need some kind of mechanism to manage the state, fulfilling the role usually played by the Keras RNN layer). But adding support for that is definitely on the TODO list!