From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:9607:0:b0:6ff:ca92:2678 with SMTP id y7-20020a379607000000b006ffca922678mr1752258qkd.612.1673229410003; Sun, 08 Jan 2023 17:56:50 -0800 (PST) X-Received: by 2002:a05:6214:5297:b0:4c7:39a8:d333 with SMTP id kj23-20020a056214529700b004c739a8d333mr4304117qvb.0.1673229409786; Sun, 08 Jan 2023 17:56:49 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 8 Jan 2023 17:56:49 -0800 (PST) In-Reply-To: <53481976-aebc-4d6d-bb8f-aa4f63f0b01b@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=118.208.175.58; posting-account=d51RWwoAAADvR-x0zYAtT9z3CRxT1eXo NNTP-Posting-Host: 118.208.175.58 References: <53481976-aebc-4d6d-bb8f-aa4f63f0b01b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Artificial Intelligence libraries in ADA From: Roger Mc Injection-Date: Mon, 09 Jan 2023 01:56:49 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2884 Xref: reader01.eternal-september.org comp.lang.ada:64780 List-Id: On Wednesday, July 10, 2019 at 5:25:50 PM UTC+10, Daniel wrote: > 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? I had a similar need involving TensorFlow. After much investigation I decided on the method suggested by http://www.inspirel.com/articles/Ada_Python_Demo.html This demo is rather simplistic and required some slight extension to be useful, mainly involving the passing of parameters to Python methods. I now have developed a fairly extensive, though probably far from complete, binding based on the inspirel method. An example of its use: Python.Initialize; MLP := Python.Import_File ("lesson_4cp"); Python.Call (MLP, "classify", Train_X, Train_Y_1D, Test_X, Test_Y_1D); Python.Close_Module (MLP); Python.Finalize; where the Python.Call is to: procedure Call (M : Module; Function_Name : String; A : ML_Arrays_And_Matrices.Real_Float_Matrix; B : ML_Arrays_And_Matrices.Integer_Array; C : ML_Arrays_And_Matrices.Real_Float_Matrix; D : ML_Arrays_And_Matrices.Integer_Array); I decided on the inspirel method as it seems fairly straightforward and requires no 3rd party packages. It only involves the Python C Api interface, for example: function PyImport_Import (Obj : PyObject) return PyObject; pragma Import (C, PyImport_Import, "PyImport_Import"); During my research I didn't come across many of the very interesting solutions mentioned in this conversation.