nengo / keras-lmu

Keras implementation of Legendre Memory Units
https://www.nengo.ai/keras-lmu/
Other
207 stars 35 forks source link

Bias and regularizers #19

Closed vsheska closed 2 years ago

vsheska commented 4 years ago

Added options for bias in the hidden cell, and support for Keras regularizers

jabowery commented 3 years ago

I'm not sure whether this is a problem with this branch or not, but I couldn't get it to work without specifying LMUCell(...include_bias=True...). Otherwise it errored out with a:

TypeError: Value passed to parameter 'x' has DataType int32 not in list of allowed values: bfloat16, float16, float32, float64 complex64, complex128

This is because in the tensorflow compiled code, the conditional returns an integer 0 if there is no bias and that causes the tanh function to fail.