Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to implement a tflite compatible SVDF layer #19962

Closed
kismeter opened this issue Jul 7, 2024 · 5 comments
Closed

how to implement a tflite compatible SVDF layer #19962

kismeter opened this issue Jul 7, 2024 · 5 comments
Assignees
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@kismeter
Copy link

kismeter commented Jul 7, 2024

Hi,

Keras layers don't have SVDF layer that compatible with tflite SVDF ops, is there any official plan to implement this? if implement a customized tflite compatible SVDF layer, is there any how to guidance?

@mehtamansi29
Copy link
Collaborator

Hi @kismeter -

There is open source repo where custom SVDF layer class is created. You can use this SVDF class to create model. After that convert that model into TFLite which you can use it on mobile device.
This link is also helpful to understand and setup kws_streaming.

The steps required to performed:
• Design a model using Keras layers and Stream wrapper.
• Train the model.
• Automatically convert the trained non-streaming Keras model to Keras streaming one.
• Convert streaming Keras model to a TFLite module.Quantize it if needed to optimize model size and performance.
• Benchmark TFLite module: measure accuracy and latency on CPU of mobile phone Pixel4

For more details regarding tflite compatible SVDF layer, kindly raise an issue in tflite repo.Thanks...!!

@mehtamansi29 mehtamansi29 added type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. stat:awaiting response from contributor labels Jul 11, 2024
@kismeter
Copy link
Author

Hi @mehtamansi29 ,

I already tried the open source custom SVDF layer, that implement can't fuse to TFLite SVDF Ops, they avoid to using TFLite custom SVDF Ops from rybakov comments, so just want to know if keras has plan to implement tflite compatible SVDF layer

@mehtamansi29
Copy link
Collaborator

Hi @kismeter -

TensorFlow Lite SVDF operations is experimental operation but not ready for custom models. For single value decomposition of matrics tf.keras.ops.svd and tf.raw_ops.Svd is there.

@mehtamansi29 mehtamansi29 added the keras-team-review-pending Pending review by a Keras team member. label Jul 11, 2024
@divyashreepathihalli
Copy link
Collaborator

divyashreepathihalli commented Jul 11, 2024

Hi @kismeter , The keras team doesnt plan on adding support for this layer. However, someone has tried to do this before - here is a link to that issue - tensorflow/tensorflow#63035

@divyashreepathihalli divyashreepathihalli removed the keras-team-review-pending Pending review by a Keras team member. label Jul 11, 2024
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

3 participants