(Jeff: can we somehow reenginer REM NN towards recurrency? Maybe by inserting recurrent layers?)
On 2022-11-10 18:58, Marius Amado-Alves wrote:
(Jeff: can we somehow reenginer REM NN towards recurrency? Maybe by
inserting recurrent layers?)
Probably best to discuss this off line. You can contact me by e-mail.
Also, Rod Kay (charlie on irc) did something re TF iirc.
On 11/11/22 06:18, Luke A. Guest wrote:
Also, Rod Kay (charlie on irc) did something re TF iirc.I generated a thin binding to the TensorFlow C API via swig4ada
around mid June. The binding has not been tested apart from a 'hello_TF'
demo which simply calls the 'TF_Version' function and prints it.
I've been distracted by other projects since but as chance would
have it, I've recently resumed work on swig4ada and TF will definitely
be one of the top priorities re testing swig4ada.
I'll try to take another look at it this weekend and to get the TF
binding onto github, if possible.
Regards.
Does anybody knows pure Ada libraries for AI?
Specially, I'm interested in Decission Trees, but I can't find anything on internet.
I case of a negative answer, does anybody knows a good CPU perforamnce AI C/C++ Library working good binded to Ada code?
On Friday, November 11, 2022 at 5:19:56 AM UTC-5, roda...@gmail.com wrote:
On 11/11/22 06:18, Luke A. Guest wrote:
I generated a thin binding to the TensorFlow C API via swig4ada
Also, Rod Kay (charlie on irc) did something re TF iirc.
around mid June. The binding has not been tested apart from a 'hello_TF'
demo which simply calls the 'TF_Version' function and prints it.
I've been distracted by other projects since but as chance would
have it, I've recently resumed work on swig4ada and TF will definitely
be one of the top priorities re testing swig4ada.
I'll try to take another look at it this weekend and to get the TF
binding onto github, if possible.
Regards.
Has this code been posted? I have been looking for some type of Ada binding to TensorFlow, and was coming up short. I'm green enough to not feel confident to just write it all myself, so I am digging around trying to find anything that might exist.
It's worth noting that these libraries may not be as feature-rich or well-maintained as some of the more popular AI libraries available in
other programming languages. However, they can still be useful for
certain projects or as a way to learn more about AI and machine learning.
On Friday, November 11, 2022 at 5:19:56 AM UTC-5, roda...@gmail.com wrote:
On 11/11/22 06:18, Luke A. Guest wrote:
I generated a thin binding to the TensorFlow C API via swig4ada
Also, Rod Kay (charlie on irc) did something re TF iirc.
around mid June. The binding has not been tested apart from a 'hello_TF'
demo which simply calls the 'TF_Version' function and prints it.
I've been distracted by other projects since but as chance would
have it, I've recently resumed work on swig4ada and TF will definitely
be one of the top priorities re testing swig4ada.
I'll try to take another look at it this weekend and to get the TF
binding onto github, if possible.
Regards.
Has this code been posted? I have been looking for some type of Ada binding to TensorFlow, and was coming up short. I'm green enough to not feel confident to just write it all myself, so I am digging around trying to find anything that might exist.
On 9/1/23 03:32, Dana B wrote:
On Friday, November 11, 2022 at 5:19:56 AM UTC-5, roda...@gmail.com wrote:
On 11/11/22 06:18, Luke A. Guest wrote:
I generated a thin binding to the TensorFlow C API via swig4ada
Also, Rod Kay (charlie on irc) did something re TF iirc.
around mid June. The binding has not been tested apart from a 'hello_TF' >> demo which simply calls the 'TF_Version' function and prints it.
I've been distracted by other projects since but as chance would
have it, I've recently resumed work on swig4ada and TF will definitely
be one of the top priorities re testing swig4ada.
I'll try to take another look at it this weekend and to get the TF
binding onto github, if possible.
I've just added the binding today.
https://github.com/charlie5/cBound/tree/master/tier-1/tensorflow
Install instructions are in the top-level 'README.md'.
Bear in mind the binding is auto generated, thin and is the C API
version '2.11.0'.
It's also auto-formatted using 'gnatpp' (for the Ada code) and 'indent'
(for the C code).
Other than the 'hello_tf' demo, it's also untested.
I'll spend some time tomorrow cleaning up the formatting and removing
some of the source code 'warts' (such as redundant 'with's).
If you try it, please let me know how it goes (especially bugs :) ).
Regards.
On 12/1/23 13:46, Roger Mc wrote:
On Wednesday, January 11, 2023 at 5:34:48 PM UTC+11, roda...@gmail.com wrote:
I've tried to install cBound and am not quite sure what I need to do.
When I try to build the library it fails with:
2023-01-12 13:37:54] /Ada_Source/cBound/tier-1/tensorflow/library/tensorflow.gpr:2:06: unknown project file: "swig"
I have installed swig4ada but it does not seem to have a gpr file.
Attempts to build the 'hello_tf' demo fails with: /Ada_Source/cBound/tier-1/tensorflow/applet/demo/hello_tf/hello_tf.gpr:2:06: unknown project file: "tensorflow"
[2023-01-12 13:42:51] /Ada_Source/cBound/tier-1/tensorflow/applet/demo/hello_tf/hello_tf.gpr:3:06: unknown project file: "swig"
Not surprising as I couldn't build the tensorflow library?
Have you followed the install instructions in the README.md ?
Install
Add the following lines to ~/.bashrc or equivalent ...
export CBOUND=/path/to/cbound
source $CBOUND/cbound-gpr_paths.sh
That should make both 'swig.gpr' and 'tensorflow.gpr' visible to your app.
On Wednesday, January 11, 2023 at 5:34:48 PM UTC+11, roda...@gmail.com wrote:
I've tried to install cBound and am not quite sure what I need to do.
When I try to build the library it fails with:
2023-01-12 13:37:54] /Ada_Source/cBound/tier-1/tensorflow/library/tensorflow.gpr:2:06: unknown project file: "swig"
I have installed swig4ada but it does not seem to have a gpr file.
Attempts to build the 'hello_tf' demo fails with: /Ada_Source/cBound/tier-1/tensorflow/applet/demo/hello_tf/hello_tf.gpr:2:06: unknown project file: "tensorflow"
[2023-01-12 13:42:51] /Ada_Source/cBound/tier-1/tensorflow/applet/demo/hello_tf/hello_tf.gpr:3:06: unknown project file: "swig"
Not surprising as I couldn't build the tensorflow library?
On Thursday, January 12, 2023 at 4:30:11 PM UTC+11, Roger Mc wrote:
My problem now is that my hello_TF build fails in compiling tensorflow_wrap.c with:
/Ada_Source/cBound/tier-1/tensorflow/source/thin/tensorflow_wrap.c:150:10: fatal error: tensorflow/tensorflow/c/c_api.h: No such file or directory
150 | #include <tensorflow/tensorflow/c/c_api.h>
As tensorflow_wrap.c was automatically generated by SWIG I'm not sure how to proceed.This problem also occurs when I attempt to build tier-1/tensorflow.
Certainly, there is no <tensorflow/tensorflow/c/c_api.h> on this computer.
My problem now is that my hello_TF build fails in compiling tensorflow_wrap.c with:
/Ada_Source/cBound/tier-1/tensorflow/source/thin/tensorflow_wrap.c:150:10: fatal error: tensorflow/tensorflow/c/c_api.h: No such file or directory
150 | #include <tensorflow/tensorflow/c/c_api.h>
As tensorflow_wrap.c was automatically generated by SWIG I'm not sure how to proceed.
Certainly, there is no <tensorflow/tensorflow/c/c_api.h> on this computer.
On Thursday, January 12, 2023 at 4:38:27 PM UTC+11, Roger Mc wrote:
On Thursday, January 12, 2023 at 4:30:11 PM UTC+11, Roger Mc wrote:
My problem now is that my hello_TF build fails in compiling tensorflow_wrap.c with:
/Ada_Source/cBound/tier-1/tensorflow/source/thin/tensorflow_wrap.c:150:10: fatal error: tensorflow/tensorflow/c/c_api.h: No such file or directory
150 | #include <tensorflow/tensorflow/c/c_api.h>
As tensorflow_wrap.c was automatically generated by SWIG I'm not sure how to proceed.
Certainly, there is no <tensorflow/tensorflow/c/c_api.h> on this computer. >> This problem also occurs when I attempt to build tier-1/tensorflow.
I'm now cloning tensorflow from Git.
Hopefully I'll be able to build it.
On Thursday, January 12, 2023 at 4:38:27 PM UTC+11, Roger Mc wrote:
On Thursday, January 12, 2023 at 4:30:11 PM UTC+11, Roger Mc wrote:
My problem now is that my hello_TF build fails in compiling tensorflow_wrap.c with:
/Ada_Source/cBound/tier-1/tensorflow/source/thin/tensorflow_wrap.c:150:10: fatal error: tensorflow/tensorflow/c/c_api.h: No such file or directory
150 | #include <tensorflow/tensorflow/c/c_api.h>
As tensorflow_wrap.c was automatically generated by SWIG I'm not sure how to proceed.
Certainly, there is no <tensorflow/tensorflow/c/c_api.h> on this computer. >> This problem also occurs when I attempt to build tier-1/tensorflow.
I'm now cloning tensorflow from Git.
Hopefully I'll be able to build it.
I've just updated the tensorflow binding (with formatting cosmetics) and pushed to github.
Does 'tensorflow/c/c_api.h' exist anywhere on your system ?
If so, you might try modifying the 'tensorflow_wrap.c' #include to use your path to the 'c_api.h'.
I doubt using a path to one of the Python system versions will work :/ .Yes, it fails due to c_api.h wanting to reference other tensorflow/c header files
Which OS are you using ?MacBook Air (13-inch, Early 2015). although purchased new from Apple in 2018! OSX restricted to version 10.13.6 High Sierra thanks to Apples planned obscelence policy.
On Thursday, January 12, 2023 at 7:01:55 PM UTC+11, roda...@gmail.com wrote:
I've just updated the tensorflow binding (with formatting cosmetics) and
pushed to github.
My build of the git cloned tensorflow failed.
Does 'tensorflow/c/c_api.h' exist anywhere on your system ?
If so, you might try modifying the 'tensorflow_wrap.c' #include to use your path to the 'c_api.h'.
c_api.h exists in numerous places, particularly in the git cloned tensorflow just downloaded.
It also exists deep in a couple of Python systems.
As the git cloned tensorflow build failed, I think my best plan is to delete it as it consumes much disk space.
I'll try using a path to one of the Python system versions.
I've updated cBound to your latest push.
Thanks for your assistance,
Roger
My hello_tf link is failing with:
gprbuild -d -eL -P/Ada_Source/cBound/tier-1/tensorflow/applet/demo/hello_tf/hello_tf.gpr --config=/Ada_Source/default.cgpr -s
Link
[link] hello_tf.adb
Undefined symbols for architecture x86_64:
"_TF_AbortWhile", referenced from:
_Ada_TF_AbortWhile in libTensorFlow.a(tensorflow_wrap.o)
(maybe you meant: _Ada_TF_AbortWhile)
etc.
I have modified the hello_tf.gpr linker section to
package Linker is
for Default_Switches ("ada") use ("-Wl,-rpath,/usr/local/lib", "-L/Users/rogermcmurtrie/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow", "-ltensorflow_framework",
"-L/Ada_Source/cBound/tier-1/tensorflow/library/lib", "-lTensorFlow");
end Linker;
On 12/1/23 22:28, Roger Mc wrote:
I have modified the hello_tf.gpr linker section toMaybe try adding "-ltensorflow" to the Linker 'Default_Switches', just
package Linker is
for Default_Switches ("ada") use ("-Wl,-rpath,/usr/local/lib", "-L/Users/rogermcmurtrie/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow", "-ltensorflow_framework",
"-L/Ada_Source/cBound/tier-1/tensorflow/library/lib", "-lTensorFlow");
end Linker;
after the "-ltensorflow_framework" switch.
Today, I'll try getting hello_tf to work on my Ventura machine using a brew installation of tensorflow.
Regards,
Roger
On Friday, January 13, 2023 at 9:09:57 AM UTC+11, Roger Mc wrote:
Today, I'll try getting hello_tf to work on my Ventura machine using a brew installation of tensorflow.Good news!
hello_tf works under my OSX Ventura after a bit of adjustment.
On Friday, January 13, 2023 at 11:12:25 AM UTC+11, Roger Mc wrote:
All I need now is a few clues on how to use the bindings.
For example, how to implement:
mnist = tf.keras.datasets.mnist
On Friday, January 13, 2023 at 9:09:57 AM UTC+11, Roger Mc wrote:
Today, I'll try getting hello_tf to work on my Ventura machine using a brew installation of tensorflow.
Good news!
hello_tf works under my OSX Ventura after a bit of adjustment.
I didn't need to change the linker settings.
Tensorflow installed by Brew includes
libtensorflow_framework.dylib and
libtensorflow.so
-ltensorflow presumably linked to libtensorflow.so
A bit strange as I thought that Apple had deprecated so files long ago.
For example, how to implement:
mnist = tf.keras.datasets.mnist
(Roger)
Yes.For example, how to implement:
mnist = tf.keras.datasets.mnist
(Roger)
Isn't Keras Python?
(If you're going to use Python, why use Ada?)The objective is to provide an example of the use of cBound in providing an interface between Tensorflow (Python) and Ada.
Why use Ada?Some of us prefer to program in Ada rather than in Python.
[The MNIST data is available independently of any language (http://yann.lecun.com/exdb/mnist/)]True.
On 13/1/23 11:40, Roger Mc wrote:Certainly.
On Friday, January 13, 2023 at 11:12:25 AM UTC+11, Roger Mc wrote:
All I need now is a few clues on how to use the bindings.
For example, how to implement:
mnist = tf.keras.datasets.mnist
Yes, indeed. I was unable to find any demo's or examples which use the
TF C API. If you find any please let me know ?
Also, I am on the #ada IRC channel at 'irc.libera.chat'. Would be greatI'll check it out.
if you could join and discuss TF in Ada there (my nick is charlie5).
Would you able to send me a patch file for the bits which did need
adjusting, so I can add it to the cBound repo ?
I'm afraid I don't know anything about Apple or MacOS except a vagueYes, MacOS is a Unix derivative and can be interacted with using standard Unix commands.
notion that it was based on one of the BSD's ?
On Friday, January 13, 2023 at 6:18:58 PM UTC+11, roda...@gmail.com wrote:
Would you able to send me a patch file for the bits which did need
adjusting, so I can add it to the cBound repo ?
Probably easier if I just report changes that I found necessary to get it to work.
A patch file would probably include stuff specific to my own installation and formatting preferences.
1. I removed "-lpthread" from Builder sections of the project (gpr) files due to builder complaint.
2. In tensorflow_wrap.c I needed to change
#include <tensorflow/tensorflow/c/c_api.h>
to
#include <tensorflow/c/c_api.h>
3. In tensorflow.gpr I needed to change
with "swig";
to
with "../../../tier-0/swig/library/swig.gpr";
4. In tensorflow.gpr I added my path to tensorflow/c/c_api.h to the Source_Dirs
In my case: "/usr/local/Cellar/libtensorflow/2.11.0/include"
5. Not sure whether or not I caused this diff statement for the gpr files: -end hello_TF;
\ No newline at end of file
+end Hello_TF;
6. In hello_tf.gpr:
-with
- "tensorflow",
- "swig";
+with "../../../library/tensorflow.gpr";
Presumably with is "swig" redundant as imported by tensorflow.gpr
On 14/1/23 09:08, Roger Mc wrote:
On Friday, January 13, 2023 at 6:18:58 PM UTC+11, roda...@gmail.com wrote:
Would you able to send me a patch file for the bits which did need
adjusting, so I can add it to the cBound repo ?
Probably easier if I just report changes that I found necessary to get it to work.
A patch file would probably include stuff specific to my own installation and formatting preferences.
1. I removed "-lpthread" from Builder sections of the project (gpr) files due to builder complaint.
2. In tensorflow_wrap.c I needed to change
#include <tensorflow/tensorflow/c/c_api.h>
to
#include <tensorflow/c/c_api.h>
3. In tensorflow.gpr I needed to change
with "swig";
to
with "../../../tier-0/swig/library/swig.gpr";
4. In tensorflow.gpr I added my path to tensorflow/c/c_api.h to the Source_Dirs
In my case: "/usr/local/Cellar/libtensorflow/2.11.0/include"
5. Not sure whether or not I caused this diff statement for the gpr files: -end hello_TF;
\ No newline at end of file
+end Hello_TF;
6. In hello_tf.gpr:
-with
- "tensorflow",
- "swig";
+with "../../../library/tensorflow.gpr";
Presumably with is "swig" redundant as imported by tensorflow.gpr
Thanks.
I've opened an issue for these problems in the github cBound repo ...
https://github.com/charlie5/cBound/issues/2
Perhaps we can continue there. This thread is getting a bit *big* :) .
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:40:36 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,858,055 |