TensorFlow - Hello World

Thanks to @mh, I was able to import TensorFlow C-API into Island.

Python is TensorFlow most-preferred language. But TensorFlow also has low-level C-APIs for binding with other languages.

RemObjects Island (Oxygene, Swift, C#) provide better alternatives than C, because we could have a strong-typed binding to TensorFlow while still enjoying all of the modern language features!

And, here is the world’s first TensorFlow Hello World in Oxygene:

1 Like

Cool! can’t wait to see what you do with it!

FTR, starting with vNext (some EBuild fixes/extensions were needed), anyone can pull in the pre-imported TensorFlow library, just by adding the following reference to your project.

<RemoteProjectReference Include="github.com/remobjects/recipes/TensorFlow/TensorFlow.elements"/>

@wuping, since the API (being C) is very low-level and non-OOP, are you planning to implement a higher-level abstraction on top of it to expose it a more OOP way? If so, I’d love to be in the loop for that and maybe get it made available to everybody as well, once ready.


1 Like

@mh Thank you Marc! Will definitely keep you in the loop.

Yes I did plan to have some “high-level abstraction in OOP way”, but it is going to be minimal for the convenience of our research project. We would still use Python to build (prototype) the TensorFlow model, while in the production system, we will just load the model using C-API or any compatible RemObjects languages. The truth is - It is almost (economically) impossible to fully replace the existing Python framework.

TensorFlow can be used as a plain Computation Graph library equipped with highly optimized CPU/GPU computation engine . In that sense, it provides a transparent bridge for RemObjects/Island to the GPU computing world without touching the dirty details of CUDA or OpenCL programming.

Thats very cool! I must admit I’m a bit behind with getting into the two whole ML scape, myself, but there’s a lot of potential there.

I found these Delphi implementations :

The last one implements low-level and higher-level API.

Thank you for the heads up. Yes I was aware of these two great Delphi implementations.

I guess the at least one advantage of Element/Island is cross-language compatibility (like mixing Oxygene and C#) on Windows and Linux platform, with all those modern language features. This means, once you have a properly designed higher-level OOP abstraction in one language, other languages automatically have that abstraction too.