From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 0531E3858D35 for ; Mon, 2 Oct 2023 06:44:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0531E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5333fb34be3so21217760a12.1 for ; Sun, 01 Oct 2023 23:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696229058; x=1696833858; darn=sourceware.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yc/5Kl2OgjyrCDmH2yYVmDwEX/fbpPurrDlwJoQCk5I=; b=hH1CFomhsPv6myVckKWqtND+bg5sWAeb1+cYdY97NbJrsBsXvTtnMEBS4Bq8ycbpm7 3hRO7KPgNTy/QM80jVN87QYWxOrr8PMw/pkNyZ6zXTzHd0HERJgmFKKfInzGXx2aw5Rh AJ89exoQGs7WEqejoi6hDJ3HnZd9RmQ0lFIevut6+8pkBRw+cGsFNVcsYs9IL41CD2EG U7TPXCcDTvBqgmOEwlnw5FLCpWN5m7oNr7N7imxje+Bgd56svHHIOqdSfDo3RRMaNU/9 gSev0B9BjRVZqFtMhbipipP8OXOMDrQ8VYgFcy8rqXudTjiQSjQpryGQwmxQbJxzYnP6 4T5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696229058; x=1696833858; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yc/5Kl2OgjyrCDmH2yYVmDwEX/fbpPurrDlwJoQCk5I=; b=vldqDcVf67f/sjEA778I9ovnre/Bq+k5htOelDZKgATrTv9id0rTuleO13nHmfisCW QGO6EiQ1giaQJIvvUmorSvchCg6k7RyzK0wSIs0DFP46Xf9HNRPvT3Z62wljer5fvLXa +NPQy9izomMVAijM/qKvyGIokBdwkvvNzzez+TFWYkwnIG9xf3EjI4WsJMD/mVR6jmCb OOM3ZzAXvTUfVn0ozeOyO/fAUSdb6Pn2DTq5yn2WiiIvLsZW5XWHFYSwsYsVE6R6XLuA p6FAwZAqaKc1Z6ghqpQkyjFOoqwqcj/LFpoGB1kMOFwJDNpsClOFz8jxxZiy7c6R1dM4 ZLAw== X-Gm-Message-State: AOJu0YwMXs9f+EucY4AKgNGZptYR2r+jkjFLhY8rORrVS8WZr4vYsi2z 0z+fZTqayHXpBebWYB/dMXdJFTJKB0TzkZscH7i8wWl4eUM= X-Google-Smtp-Source: AGHT+IFShJqfOytV9c/ih1w4WJWnrnkHgug0J1hQy4uG71SUV9rT4KMjeNkBXO+p1Uxkjqr8jaWR65nCoG8SJWfEJVs= X-Received: by 2002:aa7:d6d2:0:b0:52f:6641:4ecd with SMTP id x18-20020aa7d6d2000000b0052f66414ecdmr9285599edr.37.1696229058144; Sun, 01 Oct 2023 23:44:18 -0700 (PDT) MIME-Version: 1.0 From: Damien Mattei Date: Mon, 2 Oct 2023 08:44:06 +0200 Message-ID: Subject: warning of missing declaration function but code works To: kawa mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: hello, is there something to do to remove this sort of warnings on code working: i searched about java declaration, but instead C++ none are required/existi= ng... bash-3.2$ kawa -f curly-infix2prefix.scm /Users/mattei/Dropbox/git/AI_Deep_Learning/exo_retropropagationNhidden_laye= rs_matrix_v2-curly+.rkt curly-infix2prefix.scm:21:21: warning - no declaration seen for process-input-code-tail-rec curly-infix2prefix.scm:28:19: warning - no declaration seen for curly-infix= -read curly-infix2prefix.scm:40:21: warning - no declaration seen for curly-infix= -read curly-infix2prefix.scm:110:27: warning - no declaration seen for read-error curly-infix2prefix.scm:112:12: warning - no declaration seen for consume-to= -eol curly-infix2prefix.scm:114:11: warning - no declaration seen for my-char-whitespace? curly-infix2prefix.scm:122:12: warning - no declaration seen for read-error curly-infix2prefix.scm:131:21: warning - no declaration seen for consume-whitespace curly-infix2prefix.scm:134:24: warning - no declaration seen for read-error curly-infix2prefix.scm:137:24: warning - no declaration seen for read-error curly-infix2prefix.scm:160:54: warning - no declaration seen for neoteric-read-real curly-infix2prefix.scm:166:47: warning - no declaration seen for neoteric-read-real curly-infix2prefix.scm:171:47: warning - no declaration seen for neoteric-read-real curly-infix2prefix.scm:209:12: warning - no declaration seen for consume-to= -eol curly-infix2prefix.scm:211:11: warning - no declaration seen for my-char-whitespace? curly-infix2prefix.scm:223:37: warning - no declaration seen for neoteric-read-real curly-infix2prefix.scm:227:12: warning - no declaration seen for read-error curly-infix2prefix.scm:231:12: warning - no declaration seen for read-error curly-infix2prefix.scm:235:12: warning - no declaration seen for read-error curly-infix2prefix.scm:238:12: warning - no declaration seen for default-scheme-read curly-infix2prefix.scm:253:11: warning - no declaration seen for ismember? curly-infix2prefix.scm:253:23: warning - no declaration seen for digits curly-infix2prefix.scm:254:12: warning - no declaration seen for read-numbe= r curly-infix2prefix.scm:255:26: warning - no declaration seen for process-sh= arp curly-infix2prefix.scm:256:26: warning - no declaration seen for process-pe= riod curly-infix2prefix.scm:259:16: warning - no declaration seen for ismember? curly-infix2prefix.scm:259:43: warning - no declaration seen for digits curly-infix2prefix.scm:260:14: warning - no declaration seen for read-numbe= r curly-infix2prefix.scm:261:30: warning - no declaration seen for fold-case-= maybe curly-infix2prefix.scm:263:18: warning - no declaration seen for read-until-delim curly-infix2prefix.scm:263:40: warning - no declaration seen for neoteric-delimiters curly-infix2prefix.scm:265:28: warning - no declaration seen for fold-case-= maybe curly-infix2prefix.scm:267:16: warning - no declaration seen for read-until-delim curly-infix2prefix.scm: note - skipped 0 errors, 1 warnings, 0 notes curly-infix2prefix.scm:438:23: warning - no declaration seen for process-ch= ar The command-line was: "/opt/homebrew/Cellar/kawa/3.1.1_1/libexec/bin/kawa -f curly-infix2prefix.scm" "/Users/mattei/Dropbox/git/AI_Deep_Learning/exo_retropropagationNhidden_lay= ers_matrix_v2-curly+.rkt" ((provide (all-defined-out)) (require srfi/42) (require matrix.rkt) (include ../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/Scheme+.rkt= ) (require ../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/overload.rk= t) (include ../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/assignment.= rkt) (include ../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/apply-square-bracke= ts.rkt) (define-overload-existing-operator +) (define-overload-existing-operator *= ) (define-overload-procedure uniform) (include ../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/scheme-infix.rkt) (overload-existing-operator + vector-append (vector? vector?)) (overload-existing-operator * multiply-flomat-vector (flomat? vector?)) (define (uniform-dummy dummy) (* (random) (if (=3D (random 2) 0) 1 -1))) (define (uniform-interval inf sup) (<+ gap (- sup inf)) ($nfx$ inf + gap * (random))) (overload-procedure uniform uniform-dummy (number?)) (overload-procedure uniform uniform-interval (number? number?)) (define (=CF=83 z=CC=83) (/ 1 (+ 1 (exp (- z=CC=83))))) (define (der_tanh z z=CC=83) ($nfx$ 1 - z ** 2)) (define (der_=CF=83 z z=CC=83) (* z (- 1 z))) (define (der_atan z z=CC=83) (/ 1 ($nfx$ 1 + z=CC=83 ** 2))) (define-syntax reversed (syntax-rules () ((_ (name end)) (begin (unless (equal? (quote in-range) (quote name)) (error first argument is not in-range: (quote name))) (in-range (- end 1) -1 -1))) ((_ (name start end)) (begin (unless (equal? (quote in-range) (quote name)) (error first argument is not in-range: (quote name))) (in-range (- end 1) (- start 1) -1))))) (define ReseauRetroPropagation (class object% (super-new) (init-field (nc #(2 3 1)) (nbiter 10000) (=CE=B7=E2=82=9B 1.0) (activation_function_hidden_layer tanh) (activation_function_output_layer tanh) (activation_function_hidden_layer_derivative der_tanh) (activation_function_output_layer_derivative der_tanh)) (<+ lnc (vector-length nc)) (field (z (vector-ec (:vector lg nc) (make-vector lg 0)))) (display z=3D= ) (display z) (newline) (field (z=CC=83 (vector-ec (:vector lg nc) (make-vector lg 0)))) (displa= y z=CC=83=3D) (display z=CC=83) (newline) (define-pointwise-unary uniform) (<+ M (vector-ec (: n (- lnc 1)) (.uniform! (zeros ($bracket-apply$ nc n + 1) (+ ($bracket-apply$ nc n) 1))))) (display M=3D) (display M) (newline) (field (=E1=90=81 (for/vector ((lg nc)) (make-vector lg 0)))) (display = =E1=90=81=3D) (display =E1=90=81) (newline) (display nbiter=3D) (display nbiter) (newl= ine) (field (error 0)) (define (accepte_et_propage x) (when (=E2=89=A0 (vector-length x) (vector-length ($bracket-apply$ z 0)= )) (display Mauvais nombre d'entr=C3=A9es !) (newline) (exit #f)) (<- ($bracket-apply$ z 0) x) (<+ n (vector-length z)) (declare z_1) (declare i) (for ((<- i 0) ($nfx$ i < n - 2) ($nfx$ i <- i + 1)) ($nfx$ z_1 <- #(1) + ($bracket-apply$ z i)) ($nfx$ ($bracket-apply$ z=CC=83 i + 1) <- ($bracket-apply$ M i) * z_1) (<- ($bracket-apply$ z i + 1) (vector-map activation_function_hidden_layer ($bracket-apply$ z=CC=83 i + 1)))) ($nfx$ z_1 <- #(1) + ($bracket-apply$ z i)) ($nfx$ ($bracket-apply$ z=CC=83 i + 1) <- ($bracket-apply$ M i) * z_1) (<- ($bracket-apply$ z i + 1) (vector-map activation_function_output_layer ($bracket-apply$ z=CC=83 = i + 1)))) (define/public (apprentissage Lexemples) (<+ ip 0) (declare x y) (for-racket ((it (in-range nbiter))) (when ($nfx$ it % 100 =3D 0) (display it) (newline)) (<+ err 0.0) (<- (x y) ($bracket-apply$ Lexemples ip)) (accepte_et_propage x) (<+ i i_output_layer (- (vector-length z) 1)) (<+ ns (vector-length ($bracket-apply$ z i))) (for-racket ((k (in-range ns))) ($nfx$ ($bracket-apply$ ($bracket-apply$ =E1=90=81 i) k) <- ($bracket= -apply$ y k) - ($bracket-apply$ ($bracket-apply$ z i) k)) ($nfx$ err <- err + ($bracket-apply$ ($bracket-apply$ =E1=90=81 i) k)= ** 2)) ($nfx$ err <- err * 0.5) (when ($nfx$ it =3D nbiter - 1) (<- error err= )) (<+ =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83 activation_function_output_lay= er_derivative) (modification_des_poids ($bracket-apply$ M i - 1) =CE=B7=E2=82=9B ($bracket-apply$ z i - 1) ($bracket-apply$ z i) ($bracket-apply$ z=CC= =83 i) ($bracket-apply$ =E1=90=81 i) =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83) (<- =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83 activation_function_hidden_lay= er_derivative) (for-racket ((i (reversed (in-range 1 i_output_layer)))) (<+ nc (vector-length ($bracket-apply$ z i))) (<+ ns (vector-length ($bracket-apply$ z i + 1))) (for-racket ((j (in-range nc))) (<+ k 0) (<- ($bracket-apply$ ($bracket-apply$ =E1=90=81 i) j) (for/sum ((k (in-range ns))) (* (=E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83 ($bracket-apply$ ($bracket-a= pply$ z i + 1) k) ($bracket-apply$ ($bracket-apply$ z=CC=83 i + 1) k)) ($bracket-apply$ ($bracket-apply$ M i) k (+ j 1)) ($bracket-apply$ ($bracket-apply$ =E1=90=81 i + 1) k))))) (modification_des_poids ($bracket-apply$ M i - 1) =CE=B7=E2=82=9B ($bracket-apply$ z i - 1) ($bracket-apply$ z i) ($bracket-apply$ z= =CC=83 i) ($bracket-apply$ =E1=90=81 i) =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83)) (<- ip (random (vector-length Lexemples))))) (define (modification_des_poids M_i_o =CE=B7 z_input z_output z=CC=83_output = =E1=90=81_i_o =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83) (<+ (len_layer_output len_layer_input_plus1forBias) (dim M_i_o)) (<+ len_layer_input (- len_layer_input_plus1forBias 1)) (for-racket ((j (in-range len_layer_output))) (for-racket ((i (in-range len_layer_input))) ($nfx$ ($bracket-apply$ M_i_o j (+ i 1)) <- ($bracket-apply$ M_i_o j (+ i 1)) - (* (- =CE=B7) ($bracket-apply$ z_input i) (=E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83 ($bracket-apply$ z_output j) (= $bracket-apply$ z=CC=83_output j)) ($bracket-apply$ =E1=90=81_i_o j)))) ($nfx$ ($bracket-apply$ M_i_o j 0) <- ($bracket-apply$ M_i_o j 0) - (* (- =CE=B7) 1.0 (=E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83 ($bracket-apply$ z_output j) ($= bracket-apply$ z=CC=83_output j)) ($bracket-apply$ =E1=90=81_i_o j))))) (define/public (test Lexemples) (display Test des exemples :) (newline) (<+ err 0) (declare entree sortie_attendue =E1=90=81) (for-racket ((entree-sortie_attendue Lexemples)) (<- (entree sortie_attendue) entree-sortie_attendue) (accepte_et_propage entree) (printf ~a --> ~a : on attendait ~a entree ($bracket-apply$ z (vector-length z) - 1) sortie_attendue) (newline) ($nfx$ =E1=90=81 <- ($bracket-apply$ sortie_attendue 0) - ($bracket-apply$ ($bracket-apply$ z (vector-length z) - 1) 0)) ($nfx$ error <- error + =E1=90=81 ** 2)) ($nfx$ err <- err * 0.5) (display Error on examples=3D) (display error) (newline)))) (printf ################## NOT ##################) (newline) (<+ r1 (new ReseauRetroPropagation (nc #(1 2 1)) (nbiter 50000) (=CE=B7=E2=82=9B= 10) (activation_function_hidden_layer =CF=83) (activation_function_output_la= yer =CF=83) (activation_function_hidden_layer_derivative der_=CF=83) (activation_function_output_layer_derivative der_=CF=83))) (<+ Lexemples1 #((#(1) . #(0)) (#(0) . #(1)))) (send r1 apprentissage Lexemples1) (send r1 test Lexemples1) (newline) (printf ################## XOR ##################) (newline) (<+ r2 (new ReseauRetroPropagation (nc #(2 3 1)) (nbiter 250000) (=CE=B7=E2=82= =9B 10) (activation_function_hidden_layer =CF=83) (activation_function_output_la= yer =CF=83) (activation_function_hidden_layer_derivative der_=CF=83) (activation_function_output_layer_derivative der_=CF=83))) (<+ Lexemples2 #((#(1 0) . #(1)) (#(0 0) . #(0)) (#(0 1) . #(1)) (#(1 1) . #(0)))) (send r2 apprentissage Lexemples2) (send r2 test Lexemples2) (printf ################## SINUS ##################) (newline) (<+ r3 (new ReseauRetroPropagation (nc #(1 70 70 1)) (nbiter 50000) (=CE=B7=E2= =82=9B 0.01) (activation_function_hidden_layer atan) (activation_function_output_layer tanh) (activation_function_hidden_layer_derivative der_atan) (activation_function_output_layer_derivative der_tanh))) (<+ Llearning (vector-ec (:list x (list-ec (: n 10000) (uniform (- pi) pi))) (cons (vector x) (vector (sin x))))) (<+ Ltest (vector-ec (:list x (list-ec (: n 10) (uniform (/ (- pi) 2) (/ pi 2)))) (cons (vector x) (vector (sin x))))) (send r3 apprentissage Llearning) (send r3 test Ltest))