HuwCampbell / grenade

Deep Learning in Haskell
BSD 2-Clause "Simplified" License
1.45k stars 84 forks source link

Support ONNX? #89

Open sebeaumont opened 5 years ago

sebeaumont commented 5 years ago

Any idea if this would be a feasible thing to do? Nice idea to specify, train and verify models in Haskell then export for runtime in embedded environment, mobile or wherever.

erikd commented 5 years ago

Probably possible, but if you would like this feature, the best idea is to implement it yourself and summit it as a contribution.

sebeaumont commented 5 years ago

Ok I’ll take a look at it.

sebeaumont commented 5 years ago

Ok seems fairly straightforward from the ONNX end. They use protocol-buffers to specify the format of the graph and parameters - the semantics can be extracted from the documentation and examples for other environments. It probably makes sense to provide an Haskell onnx library and then use that in due course but in the meantime I'll flesh out the details herein. I'd like to do a quick end to end PoC first. I already did some work mapping hmatrix arrays to mm files but this would be much more useful since I'm looking at targeting TensorRT on CUDA kit.