Skip to content Skip to sidebar Skip to footer

Tensorflow Op In Keras Model

I'm trying to use a tensorflow op inside a Keras model. I previously tried to wrap it with a Lambda layer but I believe this disables that layers' backpropagation. More specificall

Solution 1:

Roughly two weeks have passed and it seems I am able to answer my own question now.

It seems like tensorflow can look up gradients if you register them using this decorator. As of writing, this functionality is not (yet) available in C++, which is what I was looking for. A workaround would be to define a normal op in C++ and wrap it in a python method using the mentioned decorator. If these functions with corresponding gradients are registered with tensorflow, backpropagation will happen 'automagically'.

Post a Comment for "Tensorflow Op In Keras Model"