Giter Site home page Giter Site logo

swift-tensorflow's Introduction

swift-tensorflow's People

Contributors

johndpope avatar nubbel avatar wwe-johndpope avatar

Stargazers

jiaxianhua avatar []\ avatar Kevin Sun avatar Sayaka avatar Kyle avatar Yifei Teng avatar Mohammad Reza Taesiri avatar Yansong Li avatar Christian Cabarrocas avatar Thamme Gowda avatar ELI JOSEPH BRADLEY avatar  avatar Louis Encontre avatar Alex Sosnovshchenko avatar  avatar Nathan Flurry avatar Andrey Volodin avatar  avatar  avatar

Watchers

 avatar  avatar James Cloos avatar

swift-tensorflow's Issues

TODO - clarify intention of project

this is the current python library / methods / functions
https://github.com/petewarden/tensorflow_makefile/tree/49c08e4d4ff3b6e7d99374dc2fbf8b358150ef9c/tensorflow/g3doc/api_docs/python

index ->
https://github.com/petewarden/tensorflow_makefile/blob/49c08e4d4ff3b6e7d99374dc2fbf8b358150ef9c/tensorflow/g3doc/api_docs/python/index.md

there isn't an equivalent python grpc library for tensorflow.

Interacting with this library via grpc is going to be like using a REST service to use tensorflow.

swift may find a home somewhere amongst the tensorflow ecosystem (backend processes) / but it's not so clear how end users can simply pick up this library and start using it to train models as is majority of use cases with people using tensorflow.

The API docs state

https://github.com/petewarden/tensorflow_makefile/blob/49c08e4d4ff3b6e7d99374dc2fbf8b358150ef9c/tensorflow/g3doc/api_docs/index.md

'Over time, we hope that the TensorFlow community will develop front ends for languages like Go, Java, JavaScript, Lua, R, and perhaps others. With SWIG, it's relatively easy to develop a TensorFlow interface for your favorite language.'

swig doesn't have swift support.

however there is an attempt to scaffold swift from cpp using this library
https://github.com/sandym/swiftpp

The current cpp library states it's use is to
'To control the execution of a graph from C++:'

using the grpc calls to mimick this behavior
'To control the execution of a graph '
is achievable, today with the grpc swift classes with enough faffing around.

but to get xcode/swift to provide the sorts of luxury of api ofpython is going to have wrap the c++ library. this has been attempted with the c api here

https://github.com/rxwei/CTensorFlow/blob/master/CTensorFlow.h

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/c/c_api.h

supposedly

https://www.tensorflow.org/api_docs/cc/namespace/tensorflow#readbinaryproto

swift + tensorflow pathways forward - Dec 2016

Swift 3 - PR

tensorflow/tensorflow#6423
(N.B. - this is a first attempt and due to limited c api - not usable)

GRPC services layer (talking to tensorflow)

grpc/grpc-swift#2
We need to programmatically spit out the associated service interface
Ideally using urlsession to wrap network calls - however nsurlsession.shared doesn't seem to have complete coverage for linux/ubuntu. http://stackoverflow.com/questions/38419999/swift-3-preview-2-linux-error-use-of-unresolved-identifier

So libcurl is seems like (today's) best alternative. perhaps swift 4 will close this gap? IBM has a swift wrapper around this
https://github.com/IBM-Swift/CCurl

Most recently a swifty version of libcurl was created.
https://github.com/dmcyk/SwiftyCurl/

some how - need to rework this logic - to read in any associated services.proto files
and inject respective SwiftyCurl calls / callback.
https://gist.github.com/johndpope/5883f41e6079999c3b2549eeced59edc

Could reference the objective-c wrappers that can be created using c++.
https://github.com/grpc/grpc/tree/master/src/objective-c

But the grpc/grpc project by google has abandoned this for swift - so a clean start tossing out that code base could have merit.

N.B. once this milestone is achieved - tensorflow still needs to provide documentation around using this grpc layer.

need to flesh out the basic example.proto file to connect to tensorflow

https://github.com/yesup/tensorflow-serving-client-java/tree/master/src/main/proto/tensorflow/core/example

I created a basic connection / although this is failing.
Need to dive in with wireshark or something to determine why it's not connecting.

There's so

```
workerService = Tensorflow_Grpc_WorkerServiceService(address: "127.0.0.1:2222")
    let request = Tensorflow_GetStatusRequest()
    let status = try? workerService.getstatus(request) { (response, result) in
        print(request)
        print(result)
        
    }
    print("status:",status)

Enhancement - plugin documentation

I think all these files by themselves probably not going to help anyone without docs.
Probably good idea to plug this in to my script.
https://github.com/estan/protoc-gen-doc

This would be nice
https://github.com/estan/protoc-gen-doc/blob/master/examples/doc/example.md

I was thinking with script - we could spit out all the libraries (c# / c++ etc )which would pick up good seo.
This library is already top page in google ranks for tensorflow swift.
More importantly - actually making progress to get this working is my intention.

Probably be best to add to readme - this link to co-ordinate efforts.
https://tensorflowtalk.slack.com/

We need a hello world sample gist of plugging in some of these scripts.

I also imagined dumping stuff into an google sheets / excel which people could look at APIs.
Maybe even do some predefined searches to gists on github
And yeah... one day this will all be superseded once Google can throw more resources at it.
But if there's enough people to get behind swift - then this could be helpful

screen shot 2016-11-06 at 12 26 45 pm

Side note - have a look at how node implements their proto handling with grpc
It doesn't actually need protoc to spit out files
https://github.com/johndpope/DockerParseyMcParsefaceAPI/blob/master/clients/node_client/index.js#L1

grpc swift has similar thing with some script called quickproto - but need to spit out an 'output' file.
I updated my script to spit these out. (see -output appendage)
https://gist.github.com/johndpope/5d176f4eebeb7ec983fa77d945c18fb1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.