Implement LSTM models

Dear team,

How should I implement an LSTM model in concrete-ml? Earlier an example was given using hnp, but it seems to have been discontinued now?

Hi @divyesh,

Yes indeed there was an lstm example in hnp but we have not addressed them so far in concrete-ml.

You can probably open an issue on GitHub - zama-ai/concrete-ml: Concrete ML: Privacy Preserving ML framework built on top of Concrete, with bindings to traditional ML frameworks.. Or if you really want them asap you could try to implement them yourself in CML through the open bounty program: Sign in to GitHub · GitHub.

1 Like

Thank you, can you also please provide some resources from where I can learn how other models are implemented in the background in concrete-ml?

You can learn how concrete-ml work on this documentation page Inner Workings - Concrete ML. Don’t hesitate to give us any feedback on things that would be unclear.

If you are thinking about making LSTM compatible. The main thing you will need to do is make concrete-ml support the LSTM onnx node. You can probably dive in with FHE Op-graph Design - Concrete ML.

Basically, when you pass your torch model to compile_torch_model, there will be a conversion from torch to onnx and then from onnx to numpy. This is in this last part that the LSTM node is missing in Concrete ML.

1 Like

@divyesh if you have any question about the Bounty program and the open bounty proposition process, feel free to DM me.

1 Like

Sure @alex. I will first go through the resources mentioned by @jfrery and let you know if I have any queries. Thank you

1 Like