From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 2B2F17EE36 for ; Tue, 29 Mar 2016 18:01:54 +0200 (CEST) IronPort-PHdr: 9a23:nwRc5RRlPPJ871zGarnIQnKCgNpsv+yvbD5Q0YIujvd0So/mwa65ZBaN2/xhgRfzUJnB7Loc0qyN4/CmAzJLscfJmUtBWaIPfidNsd8RkQ0kDZzNImzAB9muURYHGt9fXkRu5XCxPBsdMs//Y1rPvi/6tmZKSV3BPAZ4bt74BpTVx5zukbviq9uJPU4Y1XKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGY2zRakzTKRZATI6KCh1oZSz7ViQBTeIs1kRSX0biFJsBBXE91nTWJv8qDD3sKIp2iSBJcDsC7QzRDW5qa5tRBLykyoBHzE8+WDTzMd3ifQIjgimoklbypPObYeJfN93bKrHcJtOQWNcRMtXS2pEC5G1dYYnAO8IPOIepI748Qhd5SCiDBWhUbu8ggRDgWX7iOhji7ws Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=laurent.mazare@gmail.com; spf=Pass smtp.mailfrom=laurent.mazare@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f48.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of laurent.mazare@gmail.com) identity=pra; client-ip=74.125.82.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="laurent.mazare@gmail.com"; x-sender="laurent.mazare@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of laurent.mazare@gmail.com designates 74.125.82.48 as permitted sender) identity=mailfrom; client-ip=74.125.82.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="laurent.mazare@gmail.com"; x-sender="laurent.mazare@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f48.google.com) identity=helo; client-ip=74.125.82.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="laurent.mazare@gmail.com"; x-sender="postmaster@mail-wm0-f48.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DIAQCPpvpWkjBSfUpdhAFuDwa2BIR8gXAjhWoCgSsHOhIBAQEBAQEBARABAQEBBwsLCSEvgi2CFAEBAQMBEhEdARsdAQMMBgULDSoCAiEBAREBBQEcBhMIGodvAQMKCA6iG4ExPjGLNoFqgleGZgoZJw1RhBQBAQEBAQEBAwEBAQEBAQEBEgEFCgWGDoREgj+CK4JTglYFlzsxgVKEIIJygy6BdYI0jFmHO4YXER6BDicLgiYegVI7MAGIeQEBAQ X-IPAS-Result: A0DIAQCPpvpWkjBSfUpdhAFuDwa2BIR8gXAjhWoCgSsHOhIBAQEBAQEBARABAQEBBwsLCSEvgi2CFAEBAQMBEhEdARsdAQMMBgULDSoCAiEBAREBBQEcBhMIGodvAQMKCA6iG4ExPjGLNoFqgleGZgoZJw1RhBQBAQEBAQEBAwEBAQEBAQEBEgEFCgWGDoREgj+CK4JTglYFlzsxgVKEIIJygy6BdYI0jFmHO4YXER6BDicLgiYegVI7MAGIeQEBAQ X-IronPort-AV: E=Sophos;i="5.24,411,1454972400"; d="scan'208,217";a="171472812" Received: from mail-wm0-f48.google.com ([74.125.82.48]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 29 Mar 2016 18:01:46 +0200 Received: by mail-wm0-f48.google.com with SMTP id 20so32997684wmh.1; Tue, 29 Mar 2016 09:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=OWtH9gGgZ8WA36jeoiXbQP1mqAHpWrXNC2LPkrFLpEc=; b=zbpE6tIC8ZFzOIsMAocmseqiUHDyJ5aq2rHUn8nI5NaCFuZnwJl8ZYFXVQvLJ+MoGu Z/ZzLTnXgUgKx2mAfXGH7i/l4L2+1Ed1htqoQyVUYE7UdNlxjO4qyRF30qsDqN+c6rj6 QS7wWBseOyjA27jJ60S4uUTMsLxmquC+yZUhQ7QvYT41OvHgzp28Wp3Ldnbgyja+35Wt vRCTLrxGB5R66WMH7ijyCsXBWOxtBA9Dmd7Lb0QQwdzafTAYsRWWmQvlhgaozwUgP0sq lu+lTQxOuKFmCBQ005yYIeEEnwei9aUFH2apHPVqEFeACY0K+WTWzmgHqxvDqW4L62e3 KotA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=OWtH9gGgZ8WA36jeoiXbQP1mqAHpWrXNC2LPkrFLpEc=; b=LK4LhNyHq15JAXF6qeSaeJctsKXw9Z/9YWeL8RPquHnQXuBWT29OKVIkhbnphHpjCX XkSWN/qi7kY/31FXrxfLZZWWzELAPWJKXpKoBmNvJDPiuc061f1BkA2QVi/IEPD2qTBm 9NaDeezgEI+Dijetm7v7Vy3GBCcRucLFBF6NsGtm+/QGG3juULjwTr1dPHW9UmV57Rzg 5BGiRX61U6UYaVqzbjTFpWq8CH1NIGxTOwAS1uoe6XFbem9KF9RwyyeQ7Y/nzH9xF+AF 7Gwtbhmz3DoCqSuU7b3r9Exof1zMWQyKraMB8qqVKdtpNpKRt1PUx+Z8ZOO/vCliGgSj Po3w== X-Gm-Message-State: AD7BkJKYdyWH9KAVXIbRMgYSHZSzgz8CB9IZEFMsmJe0T7nKVgjRGeciXKg3oI0gAl9S2M0IBlM8ouyZC+heXg== MIME-Version: 1.0 X-Received: by 10.28.234.69 with SMTP id i66mr2122960wmh.96.1459267266637; Tue, 29 Mar 2016 09:01:06 -0700 (PDT) Received: by 10.28.130.209 with HTTP; Tue, 29 Mar 2016 09:01:06 -0700 (PDT) In-Reply-To: References: <56E18D54.2010306@inria.fr> Date: Tue, 29 Mar 2016 17:01:06 +0100 Message-ID: From: Laurent Mazare To: Jesper Louis Andersen Cc: Milo Davis , Francois Berenger , Caml List Content-Type: multipart/alternative; boundary=001a1146ad9c0f7fa8052f322303 Subject: Re: [Caml-list] Tensorflow bindings for OCaml --001a1146ad9c0f7fa8052f322303 Content-Type: text/plain; charset=UTF-8 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 > 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. > --001a1146ad9c0f7fa8052f322303 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
We've started putting together some TensorFlow bi= ndings for OCaml. It's very much a work in progress so there are some r= ough 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 tra= in a convolutional neural network to recognize digits with 98% accuracy.
Here are a couple highlights:
- The code for most ope= rators is automatically generated from the TensorFlow protobuf specs.
=
- The supported optimizers are gradient descent, momentum, and the ada= m optimizer.
- The gradient backpropagation graph is generate= d within the OCaml wrapper. We need to register the gradients for each oper= ator manually, this has already been done for ~30 operators.
- Th= e api should be pretty straightforward, as an example here is a simple line= ar classifier for the MNIST dataset:
Installation is = quite tricky for now as one has to compile or extract libtensorflow.so but = we're hoping to improve this soon.

Any feedbac= k would be very welcome.

(this has been cross-post= ed to the tensorflow-discuss group)
<= br>
On Thu, Mar 10, 2016 at 7:58 PM, Jesper Louis= Andersen <jesper.louis.andersen@gmail.com> wr= ote:

On Thu, Mar 10, 201= 6 at 6:43 PM, Milo Davis <davis.mil@husky.neu.edu> wro= te:
Okay.=C2=A0 I'll see what needs t= o be done to wrap the C++ code.=C2=A0 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 tensore= d variant of Janes St.'s incremental library.

I'd definitely start by get= ting 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 n= eed a better language than Python for some TF-work :)


--
J= .

--001a1146ad9c0f7fa8052f322303--