lava-nc / lava-dl

Deep Learning library for Lava
https://lava-nc.org
BSD 3-Clause "New" or "Revised" License
149 stars 71 forks source link

Recurrent netx save and load #324

Closed timcheck closed 2 months ago

timcheck commented 2 months ago

Issue Number: https://github.com/lava-nc/lava-dl/issues/327

Objective of pull request: As a user, I want to be able to save and load dense recurrent networks from lava-dl into lava.

Pull request checklist

Your PR fulfills the following requirements:

Pull request type

Please check your PR type:

What is the current behavior?

Cannot save/load recurrent network with NetX.

What is the new behavior?

A new hdf5 layer category for dense recurrent layers allows saving recurrent networks to an hdf5 file.

NetX can load into Lava a recurrent network from an hdf5 file.

A unit test shows example usage. An example 2-layer 5-neuron dense recurrent network is created in Lava-dl, saved to a hdf5 file, and loaded into Lava from the hdf5 file. The network is run in both Lava-dl and Lava on an example input to confirm matching activity level within an error margin of 2%.

Does this introduce a breaking change?

timcheck commented 2 months ago

Thanks @bamsumit, I converted the example to a unittest.