kotlindl icon indicating copy to clipboard operation
kotlindl copied to clipboard

[Question/Request] More Low-level acces to tensorflow

Open stheid opened this issue 2 years ago • 2 comments

For my research i need to read out the gradients during backpropagation. However most classes (Sequential) can not be inherited and most variables are internal or private.

Would it be possible to expose more of the internal api to get optional more low level access to the api and allow for easier extension?

Similar to: https://github.com/Dongdongshe/neuzz/blob/2c7179557a491266ca1478e5f8c431d0b69d3e3a/nn.py#L267 And: https://www.tensorflow.org/overview image

stheid avatar Dec 13 '21 16:12 stheid

Hi @stheid, thank you for your question. At this moment we have plans to make the hierarchy of classes open with the ability to make possible the inheritance for the main building blocks of the KotlinDL like layers, initializers, activation functions, callbacks, metrics, and loss functions, probably we should do it and for Sequential and Functional models (need to think about it)

But due to usage under the hood, the TF runtime 1.15 and limitation of Java API for the TF 1.15 and TF 2.x developed the Eager Mode and Gradient Tape are not supported and you will not have access to the gradients like in Python

Hope it will be possible in the future (and some works are in progress, for example, registration of the custom gradients) and KotlinDL will be useful for scientific research in the future.

zaleslaw avatar Dec 15 '21 11:12 zaleslaw

Thanks for the informative reply. I think that means that KotlinDL is of the table for now, but i will keep a close eye on the development and maybe use it in the future ;)

stheid avatar Dec 16 '21 07:12 stheid