pplonski / keras2cpp

This is a bunch of code to port Keras neural network model into pure C++.
MIT License
679 stars 153 forks source link

LSTM to CPP, who has good method? #37

Open fengtongtong opened 6 years ago

MatthewScholefield commented 5 years ago

Of relevance: #1

rspadim commented 5 years ago

Not sure but maybe numpy keras Backend?

https://github.com/keras-team/keras/blob/master/keras/layers/recurrent.py

https://github.com/keras-team/keras/blob/master/keras/backend/numpy_backend.py

sidharth1010 commented 5 years ago

I have an LSTM model built with Keras framework. This model is for the next word prediction based on the previous text entered by the user. So I have written a function in python which is loading this Keras model and a tokenizer file(for word-sequences) into it and using inbuilt functions like predict_classes and pad_sequences to make next word predictions. I have to convert this function to C++, so can anyone help me out how to use this repo for my use. I tried using Cython but that didn't help as it converts a 52 line code in Python to 4000 line code in C++ which is not convenient. It is inconvenient to debug the 4000 line of code without knowing its relevance.