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:
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)