From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 15E563858D32 for ; Tue, 14 Nov 2023 22:17:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15E563858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 15E563858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::534 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700000278; cv=none; b=HvbWWyDX00VC/whEmwBJ7SVtXG23/amaerzG9Pp6z+qEyQpuZD3C8SOCLJJFCXfkTt2cNUzod9PRGah2eEC+Qq7P8Gj62pFTC+fCW3y2r2bbHmXbRdkjAzwk+y7zNbUeY0SV+3xIiWYRO7oIJvMaRdQIGRp8jxxYLz22ZlFIU5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700000278; c=relaxed/simple; bh=UYGZb47gAq3sZ1ROhxrjPps9mqceG3dph6M1N4xRZmg=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=GN+UedQJAA0PVQddXbe1n9lxxIS3fcESa+fHZNL5KujxtoqjddD6rBeoq9ccrN8GkWeNEgSFTXJwmbKWOI9zSKSSDGxOSg6cOS18Rs6ehkPGTYVkxq1cwTf9ZflLxFd/XZ1ggl9JjaG6cDzy0mx84w9fvbaMYA9w+GnpU9/0kEo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53e04b17132so9564545a12.0 for ; Tue, 14 Nov 2023 14:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700000275; x=1700605075; darn=sourceware.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=USAbmxl0rTaMz+6HeyRcvhuiNe6jGkZgXT7Pz2e4/4s=; b=C0hCXHmqVPmvkz9nO8ISqKUV7wlelXSDmO3uOKY7ysfkAKqoFze8YzVgBS9tGY+tAN gyM8xhMQh0qvc1Z9CRsyvFH40cP3CEmvhkBM1SrdrzLe0fCezp/5cBqcdRcC9MbSBJw2 bIoKl3RgL8D3lt/0wZ4s0/uT634+qJAgOPVbX+u9PvDxYf/WNvM7UGJGal7KkeAfH5Fj BezdS2m9tI9en3F/bHAB3L9XBoTdQy3DmRMkG0nAfwy73eq/7/onSMjZhq3EEmD0EmNz HVTC7medADE6RpNRuc8dirEpmIqMlaodEFqOD7IHBUYAAelYtB4HKXqUewan4hnVE9mk Zz3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700000275; x=1700605075; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=USAbmxl0rTaMz+6HeyRcvhuiNe6jGkZgXT7Pz2e4/4s=; b=g5PgcfnlwgxCCiCmUf3idOPdsxLfgEN/s4kodSbiLjy2EGhX2lexYKyxQ47c8QExQ9 j5mBEI+CGkkF8ELFZ4Bj88nwXXn36906ORM9PeWDFX++f5CV/scSECi1qIeJCm0yglc4 9NIE+0HAuNSod17ZiWX0IFwCxzhpQ5VItL6TBJLPMETvQufBwCrL6KBIgmRBOShFy0mx 5jQFvCwCbYl9Eb7glGPtIEkmVJtZ8PNQn+DL0Sd18x/cS8XiDv3uMi3qIecSuGU0rkuT 2wX80OOcouZNJC+RS+o2pPxfn7chwxODYbfN31B8xWY2FfIx6gf20ei+Y8JDx5La6DEG dRSw== X-Gm-Message-State: AOJu0YyoPFD0r8m+RbQtcBz0N0NMih5G90pgjbqQfQWKmRAhggTomwlT mCDT1am4NbypLZ2XPAwnFZUd6f4ZtQE7lcBoltcmJ3lCAN7mhQ== X-Google-Smtp-Source: AGHT+IH9d7hNYW3P5cc0BpSpnxdSPCCSSvSwJ7KDeBlOvcufmJUsIfFM4GOKH0WUZw6dcqWgfEcfhBZcbi3HaCjBNcA= X-Received: by 2002:aa7:d699:0:b0:543:f7f5:83e5 with SMTP id d25-20020aa7d699000000b00543f7f583e5mr7670871edr.29.1700000275235; Tue, 14 Nov 2023 14:17:55 -0800 (PST) MIME-Version: 1.0 From: Damien Mattei Date: Tue, 14 Nov 2023 23:17:44 +0100 Message-ID: Subject: Scheme+ for Kawa and example To: kawa mailing list Content-Type: multipart/alternative; boundary="00000000000086067a060a242821" 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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: --00000000000086067a060a242821 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable hello, here is an example of function and a full example of code written in Scheme+ for Kawa: ; modify coefficients layer (define (modification_des_poids M_i_o =CE=B7 z_input z_output z=CC=83_outpu= t =E1=90=81_i_o =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83) ; derivative of activation function of= the layer ; the length of output and input layer with coeff. used for bias update {(len_layer_output len_layer_input_plus1forBias) <+ (dim-matrix M_i_o)} ; use values and define-values to create bindings {len_layer_input <+ {len_layer_input_plus1forBias - 1}} (for-each-in (in-range len_layer_output) ; line (lambda (j) (for-each-in (in-range len_layer_input) ; column , parcours les colonnes de la ligne sauf le bias (lambda (i) {M_i_o[j {i + 1}] <- M_i_o[j {i + 1}] - {(- =CE=B7) * z_input[i] * =E1=83=9Bz=E2=B3=86=E1=83=9Bz=CC=83(z_output[j] z=CC=83_output[j]) * =E1=90= =81_i_o[j]}})) ; and update the bias {M_i_o[j 0] <- M_i_o[j 0] - {(- =CE=B7) * 1.0 * =E1=83=9Bz=E2= =B3=86=E1=83=9Bz=CC=83(z_output[j] z=CC=83_output[j]) * =E1=90=81_i_o[j]}}))) the full code example is available here (best viewed with Safari due to z= =CC=83 special character in this example): https://github.com/damien-mattei/AI_Deep_Learning/blob/c7c9794627f4d498f86f= 7ddf94d56517c5be1f7f/exo_retropropagationNhidden_layers_matrix_v2_by_vector= s4kawa%2B.scm#L78 and the current version of Scheme+ for Kawa code is available here: https://github.com/damien-mattei/Scheme-PLUS-for-Kawa it is now available as a simple module in Kawa that can be loaded this way: (require Scheme+) but due to the lack of SRFI 105 curly infix in Kawa a Scheme+ program must be parsed before by curly-infix2prefix4kawa.scm to convert it in Kawa scheme code like this: curly-infix2prefix4kawa.scm kawa_code+.scm | tr -d '|' > kawa_code.scm Damien --00000000000086067a060a242821--