eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
936 stars 96 forks source link

The low-level tensorflow API is very incomplete, e.g. missing tf.where and tf.layer. #92

Closed strelec closed 6 years ago

strelec commented 6 years ago

Thanks for making the effort of writing this library.

I feel that because so many features are missing, it would be useful to keep the namespaces for the low-level library same as python, so people can easily see what is supported and what is not.

eaplatanios commented 6 years ago

No problem! I hope you find it useful! I don't think there are so many features that are missing. I have re-structured some parts because I felt I didn't like the way some things are organized in the Python API, but you should still be able to find most features.

Regarding tf.where and tf.layer that you asked for:

I'm sorry for the confusion with some of the restructuring. I could document things better and add a tutorial at some point, but I haven't gotten the chance to do that yet, because I'm working on this as a side project and using it in my research.

Let me know if you have any questions and I'd be more than happy to help! Suggestions are also super welcome. :)

strelec commented 6 years ago

Thanks, I am still thinking whether I should start with your library or with the Python one. I understand that you mean low and high level api are compatible. Maybe you should mention this.

And I was also not able to find RMSProp optimizer.

ps: I am also having a huge trouble instantiating a Session. It was one line with python.

eaplatanios commented 6 years ago

@strelec All I can say about whether you should start using this library, is that if you like and prefer Scala over Python and you like strong typing, then it might be worth giving it a try. I use it for my research and I've even built a fully fledged machine translation pipeline on top of it (I'll be releasing it soon), and I have no problems with it. It actually helps avoid a lot of issues early on, with compilation, and it's also faster than the Python API in some aspects.

I'll add support for RMSProp tonight as it's a only a few lines of code. You can use AMSGrad for now if you want, which is an improved version of Adam, that avoids a problem Adam has.

Regarding instantiating a session, can you please give me some more information? What is your trouble? It should be as simple as this:

import org.platanios.tensorflow.api._

...

val session = tf.Session()
eaplatanios commented 6 years ago

@strelec Sorry I just realized this last line should have been just:

val session = Session()
eaplatanios commented 6 years ago

@strelec I added support for RMSProp in 75584ed801f86458ea88ae1d6113f8a12f766e29. It is included in release 0.2.0-SNAPSHOT.

I'll go ahead and close this issue in this case. Please feel free to reopen if you feel there is still something missing, or if you can still not instantiate a session and I'll be happy to help. :)