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

Roadmap of node-tensorflow #15

Open
bryanerayner opened this issue May 14, 2016 · 6 comments
Open

Roadmap of node-tensorflow #15

bryanerayner opened this issue May 14, 2016 · 6 comments

Comments

@bryanerayner
Copy link

bryanerayner commented May 14, 2016

Just getting started looking at this. I was attempting to use TensorFlow earlier, but was severely hampered by the Python-only API. (Translation: I have too much on my plate to learn how to use another web framework in another language, just to play around).

That said - It appears to me that most of the difficulty here, is that the C++ API does not contain the full functionality that the Python API provides, and we might need to duplicate a lot of logic in order to implement the full level of capability in this module.

I am wondering, if this almost is a blessing in disguise, since

  • Node is async-first. Python doesn't do things with streams, but Node developers would naturally expect to be able to use them as inputs / outputs with the Tensor graph.
  • Javascript has single value returns as of now (Python has a really nice tuple output from its functions, so it's possible that the API won't feel 100% natural no matter how we slice it)
  • There's no equivalent of numpy in the Node world, and Python range comprehension is nothing like what we (don't) have in Javascript.

I think a re-envisioning of the Python API will be necessary to turn this into a truly useful module, so perhaps it shouldn't be avoided.

@tngan
Copy link
Contributor

tngan commented May 15, 2016

@bryanerayner The C++ graph building API is being redone right now by official Tensorflow team. We are still in the first step of roadmap, building the graph running stuff. (ref: tensorflow/tensorflow#37)

@quantuminformation
Copy link

I wonder why Google don't release a Node compatible version.

@ralusek
Copy link

ralusek commented Jul 12, 2016

@bryanerayner I agree that JS streams or rxJS are well suited. Single value returns can always just return an array, or preferably an object. Alternatively, ES6 syntax has exactly what you're looking for (which runs fine in Node without precompiler) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

In python you might return 2 values in a tuple. In JS you'd just return the array and use destructuring assignment.

let [a, b] = returnsTuple();

// a == first value in tuple
// b == second value in tuple

@bryanerayner
Copy link
Author

You know, I hadn't thought about how destructuring was essentially the Python tuple syntax. Thanks for that.

@gavindoughtie
Copy link

It would seem to me that there's the possibility of an "intermediate" C++ library that would implement some amount of the current Python-only code, and then idiomatic ES2016 bindings atop that. For running a network, there should be a pure-JS version so we can do browser-side intelligence.

@EddieOne
Copy link

EddieOne commented Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants