caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Laurent Mazare <laurent.mazare@gmail.com>
To: Jesper Louis Andersen <jesper.louis.andersen@gmail.com>
Cc: Milo Davis <davis.mil@husky.neu.edu>,
	Francois Berenger <francois.berenger@inria.fr>,
	 Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Tensorflow bindings for OCaml
Date: Tue, 29 Mar 2016 17:01:06 +0100	[thread overview]
Message-ID: <CAObQTrV+7eArahiOjfn8gQkwZDuUKaF63Qa4uNZ4N5ex5zrdeQ@mail.gmail.com> (raw)
In-Reply-To: <CAGrdgiXK8kYGXzmY0FV0KM2VUrYVhDGQGWtXadBef9H0XyQeEw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

We've started putting together some TensorFlow bindings for OCaml. It's
very much a work in progress so there are some rough edges: some operators
are not supported, the api is likely to change, you may even get some
segfaults, etc. However it can already be used to train a convolutional
neural network to recognize digits with 98% accuracy.
Here are a couple highlights:
- The code for most operators is automatically generated from the
TensorFlow protobuf specs.
- The supported optimizers are gradient descent, momentum, and the adam
optimizer.
- The gradient backpropagation graph is generated within the OCaml wrapper.
We need to register the gradients for each operator manually, this has
already been done for ~30 operators.
- The api should be pretty straightforward, as an example here is a simple
linear classifier for the MNIST dataset:
https://github.com/LaurentMazare/tensorflow-ocaml/blob/master/examples/mnist/mnist_linear.ml

Some installation instructions can be found on the main page of the project.
https://github.com/LaurentMazare/tensorflow-ocaml
Installation is quite tricky for now as one has to compile or extract
libtensorflow.so but we're hoping to improve this soon.

Any feedback would be very welcome.

(this has been cross-posted to the tensorflow-discuss group)

On Thu, Mar 10, 2016 at 7:58 PM, Jesper Louis Andersen <
jesper.louis.andersen@gmail.com> wrote:

>
> On Thu, Mar 10, 2016 at 6:43 PM, Milo Davis <davis.mil@husky.neu.edu>
> wrote:
>
>> Okay.  I'll see what needs to be done to wrap the C++ code.  Google
>> recommends using Swig.
>
>
> If memory serves, you only need to support around 4-5 function calls in
> order to load graphs and use them in sessions. The graph itself can be
> built in python, and the interface looks much like a tensored variant of
> Janes St.'s incremental library.
>
> I'd definitely start by getting that part working first, and then add the
> remaining functions if need be. But I wouldn't make that a priority. If you
> do succeed however, I need a better language than Python for some TF-work :)
>
>
> --
> J.
>

[-- Attachment #2: Type: text/html, Size: 3235 bytes --]

  reply	other threads:[~2016-03-29 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10  2:19 Milo Davis
2016-03-10 15:05 ` Francois Berenger
2016-03-10 17:43   ` Milo Davis
2016-03-10 17:54     ` Travis
2016-03-10 19:58     ` Jesper Louis Andersen
2016-03-29 16:01       ` Laurent Mazare [this message]
2016-03-30 15:12         ` Jesper Louis Andersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAObQTrV+7eArahiOjfn8gQkwZDuUKaF63Qa4uNZ4N5ex5zrdeQ@mail.gmail.com \
    --to=laurent.mazare@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=davis.mil@husky.neu.edu \
    --cc=francois.berenger@inria.fr \
    --cc=jesper.louis.andersen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).