From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: guile-user Digest, Vol 193, Issue 30 Date: Thu, 27 Dec 2018 02:16:10 -0200 Message-ID: <20181227021610.6a8904c6@capac> References: <6bf4cf28-8063-33a6-7dca-a9759fe71f5b@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/3GUju6LPW.RVmC07iIPw_NL"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1545884096 15521 195.159.176.226 (27 Dec 2018 04:14:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 04:14:56 +0000 (UTC) Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Dec 27 05:14:52 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcN4N-0003va-SC for guile-user@m.gmane.org; Thu, 27 Dec 2018 05:14:51 +0100 Original-Received: from localhost ([127.0.0.1]:49409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcN6U-0005UY-9L for guile-user@m.gmane.org; Wed, 26 Dec 2018 23:17:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcN61-0005UN-1R for guile-user@gnu.org; Wed, 26 Dec 2018 23:16:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcN5w-00021O-1s for guile-user@gnu.org; Wed, 26 Dec 2018 23:16:32 -0500 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:58932) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gcN5v-0001uK-Lq for guile-user@gnu.org; Wed, 26 Dec 2018 23:16:27 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 20DE31BE00EB; Thu, 27 Dec 2018 05:16:25 +0100 (CET) Original-Received: from maximusconfessor.all2all.org ([127.0.0.1]) by localhost (maximusconfessor.all2all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LCeC3vJ99LnS; Thu, 27 Dec 2018 05:16:25 +0100 (CET) Original-Received: from capac (189-70-205-45.user.veloxzone.com.br [189.70.205.45]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id F298F1BE00E3; Thu, 27 Dec 2018 05:16:21 +0100 (CET) In-Reply-To: <6bf4cf28-8063-33a6-7dca-a9759fe71f5b@gmail.com> X-Mailer: Claws Mail 3.17.2 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 79.99.200.102 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15151 Archived-At: --Sig_/3GUju6LPW.RVmC07iIPw_NL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Zelphir, > > AIscm > > http://wedesoft.github.io/aiscm > Thanks David, You are welcome! > I've added these to my notes for further investigation : ) > In SciPy and if I am not mistaken in the Python bindings for OpenCV they > also use NumPy ndarray to represent images and it feels quite natural, > so it makes sense to me to use n-dimensional arrays for this. Note that when I'm saying that images are a collection of n-dim arrays, I am referring to the 'human representation' of things: all (fast) image library= that I'm aware of internally use homogeneous vectors to store image channels. > It seems the "uniform numeric vectors" of Guile are an implementation of > the vectors in SRFI-4 as per: > https://www.gnu.org/software/guile/manual/html_node/Uniform-Numeric-Vecto= rs.html#Uniform-Numeric-Vectors. Afaict, in Guile, there is no other "uniform numeric vectors" implementatio= n then the one specified in (srfi srfi-4). > So far I have a very naive but working matrix operation implementation > here (WIP): > https://gitlab.com/ZelphirKaltstahl/neural-network/blob/dev/matrix.scm Hum, neural network ... you definitely want to consider using AIscm instea= d, which just added a binding to the tensor flow library: https://lists.gnu.org/archive/html/guile-user/2018-12/msg00070.html [ this email includes a detailed (well commented) example of a [ (very) famous (basic) example of NN training in the NN world ... > I think, once I have a good idea about how to use a fitting library or > how to interface with a library of another programming language, I > should be able to switch ... You should consider using one of the libs I 'linked' in my previous message= , and given your objective is NN, iiuc, AIscm (and Guile-CV - but it does not hav= e a NN lib binding yet) probably are your friends here ... > Yesterday I tried to use my transpose procedure and it turns out I > sooner run out of RAM (8GB) than the thing slows down ... >... Guile-CV is fast (as fast as, sometime a lot faster then InageJ [1], which,= with OpenCV, is a reference in the image processing and analysis world). Howeve= r, it will never reach the performance offered by libs that uses GPU (such as ten= sorflow just to name one). Now, using Guile-CV, on my relatively slow laptop (i5-2450M CPU @ 2.50GHz = =C3=97 4 - 6GB RAM): scheme@(guile-user)> ,use (cv) scheme@(guile-user)> (im-make 1000 1000 1) $5 =3D (1000 1000 1 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 = 0.0 # =E2=80=A6))) scheme@(guile-user)> ,time (im-transpose $5) $6 =3D (1000 1000 1 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 = 0.0 # =E2=80=A6))) ;; 0.342220s real time, 0.367022s run time. 0.040217s spent in GC. scheme@(guile-user)> (im-make 1000 10000 1) $7 =3D (1000 10000 1 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0= 0.0 # =E2=80=A6))) scheme@(guile-user)> ,time (im-transpose $7) $8 =3D (10000 1000 1 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0= 0.0 # =E2=80=A6))) ;; 3.186683s real time, 3.374562s run time. 0.303187s spent in GC. But I see that im-transpose still is pure scheme code, I'll write the low l= evel operation in C and post back ... Cheers, David [1] https://imagej.nih.gov/ij/ --Sig_/3GUju6LPW.RVmC07iIPw_NL Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAlwkUgoACgkQ83T9k6MF etfd2Qf/S1MS0eCmUlOjd7Fqft+WxtKFAhK+8CkV5FN3fhY6qxlEj6HkPylfEM9f A2WFdA4CIq4voz1agDnqsrcosc8fW3I3ChpxQhh2Hr7lWsi8ZWzf15PAdj7cGDKs nQvc5Oj0/3dVsTeA3Zltg6UYO9h/eG1/Kgecjv07V0ib4BYXLuhY73eKISNCGlvM kf45klVqWTPnex3BkLBaLOL3DmTdIZh09SOlVbt7qshfCb8LWBtlVAxWEicRHgsv lp3GXfd2CLgdU6w2EYmWB1UXhJ6ETI9cIIg1Fc2kVINwzMFUUtiE9gZZWpTmI7ip Z9ap8cz2R833N6d2C180eWUIWwwWfQ== =guBT -----END PGP SIGNATURE----- --Sig_/3GUju6LPW.RVmC07iIPw_NL--