program RESNEURONAL; (*-------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (*------------------------------------------------- Definition des outils de gestion de l'envirronement graphique --------------------------------------------------*) unit ekran: iiuwgraph class; (* Tracage d'une boite *) unit box : procedure(x,y,xl,yl,co : integer); begin call color(co); call move(x,y); call draw(x+xl,y); call draw(x+xl,y+yl); call draw(x,y+yl); call draw(x,y); end box; (* Impression des coefficients non nuls d'une matrice (n*n) *) unit circles_in_box : procedure( invers_img,x,y,n:integer , boite :mat ); var i,j : integer; begin for i:=1 to n do for j:=1 to n do (* teste le mode d'impression ("inverse motif" ou non) *) if (invers_img=1) then if (boite.tab(j,i)=/=0) then call color(1) else call color(0) fi else if (boite.tab(j,i)=/=0) then call color(0) else call color(1) fi fi; call cirb(x+(i-1)*10,y+(j-1)*10,5,0,0,0,1,1,1); call cirb(x+(i-1)*10+1,y+(j-1)*10+1,4,0,0,0,1,1,1); call cirb(x+(i-1)*10+2,y+(j-1)*10+2,3,0,0,0,1,1,1); call cirb(x+(i-1)*10+3,y+(j-1)*10+3,2,0,0,0,1,1,1); call cirb(x+(i-1)*10+4,y+(j-1)*10+4,1,0,0,0,1,1,1) od od end circles_in_box; (* Tracage d'un graphique a partir d'une matrice de reels donnee a une echelle donnee *) unit graphique : procedure( tab_don:arrayof integer , posx,posy:integer , val_initx,pasx, val_inity,pasy:real , leg_absc,leg_ord : string ); var i,j,transl,nouvelx,nouvely : integer; begin (* Trace des axes *) call move(posx,posy); call draw(posx,posy-150); call move(posx,posy); call draw(posx+400,posy); call move(posx,posy-150); call draw(posx+5,posy-140); call move(posx,posy-150); call draw(posx-5,posy-140); call move(posx+400,posy); call draw(posx+390,posy-5); call move(posx+400,posy); call draw(posx+390,posy+5); call grstrwrite(posx+410,posy,leg_absc); call grstrwrite(posx,posy-160,leg_ord); (* Impression du pas *) nouvelx:=posx;nouvely:=posy; j:=upper(tab_don)-lower(tab_don); transl:=0; for i:=0 to j do call grintwrite(1,posx+i*(400 DIV j),posy+20,val_inity+i*pasy); call grintwrite(1,posx-20,posy-i*(150 DIV j),val_initx+i*pasx); call move(nouvelx,nouvely); call draw(posx+i*(400 DIV j),posy-tab_don(i+1)*(150 DIV j)); nouvelx:=posx+i*(400 DIV j); nouvely:=posy-tab_don(i+1)*(150 DIV j); transl:=tab_don(i+1) od end graphique; (* Ecriture d'un texte *) unit grstrwrite : procedure( x,y : real , s:string); var a:arrayof char, i:integer; begin call move(x,y); a:=unpack(s); for i:=lower(a) to upper(a) do call HASCII(ORD(a(i))) od; end grstrwrite ; (* Ecriture d'un reel quelconque < 10 *) unit grintwrite : procedure( co,x,y:integer , nbe:real ); var i,j:integer; begin call color(co); (* On rend d'abord le reel entier *) j:=nbe*1000; (* Puis on l'affiche en (x,y) *) for i:=0 to 4 do call move(x-i*8,y); if i=3 then call HASCII(ORD('.')) else call HASCII(j MOD 10 +48) ; j:=j DIV 10 fi od end grintwrite; (* Saisie a la souris des formes proposees par l'utilisateur *) unit souris:mouse procedure; var b,h,hs,hg,v,vs,vg,p,i,j,val:integer,l,r,c,ecrire,gommer: boolean; begin val:=1; ecrire:=false; gommer:=false; call box(117,87,196,208,1); call grstrwrite(175,285,"F I G U R E"); call box(119,89,192,192,1); call showcursor; call box(400,125,140,100,1); call grstrwrite(425,210,"S O U R I S"); call box(403,128,134,75,1); call grstrwrite(410,140,"BOUTON 1: LEVE"); call grstrwrite(410,160,"BOUTON 2: STYLO"); call grstrwrite(410,180,"BOUTON 3: FIN "); do call status(h,v,l,r,c); if not(ecrire) then call move(h,v) fi; if ecrire then j:=entier((h-130) DIV 10)+1;i:=entier((v-100) DIV 10)+1; hg:=(j*10)+125;vg:=(i*10)+95; if (hg>=135 and hg<=295 and vg>=105 and vg<=265) then forme.tab(i+1,j+1):=val; call cirb(hg-5,vg-5,5,0,0,0,1,1,1); call cirb(hg-4,vg-4,4,0,0,0,1,1,1); call cirb(hg-3,vg-3,3,0,0,0,1,1,1); call cirb(hg-2,vg-2,2,0,0,0,1,1,1); call cirb(hg-1,vg-1,1,0,0,0,1,1,1) fi fi; hs:=inxpos;vs:=inypos; call getpress(0,h,v,p,l,r,c); if p=1 then ecrire:=not(ecrire); if ecrire then call color(0); call grstrwrite(410,140,"BOUTON 1: LEVE"); call color(1); call grstrwrite(410,140,"BOUTON 1: BAISSE") else call color(0); call grstrwrite(410,140,"BOUTON 1: BAISSE"); call color(1); call grstrwrite(410,140,"BOUTON 1: LEVE") fi; if gommer then call color(0) fi fi; call move(hs,vs); hs:=inxpos;vs:=inypos; call getpress(2,h,v,p,l,r,c); if p=1 then gommer:=not(gommer); if gommer then val:=0; call color(0); call grstrwrite(410,160,"BOUTON 2: STYLO"); call color(1); call grstrwrite(410,160,"BOUTON 2: GOMME"); call color(0) else val:=1; call color(0); call grstrwrite(410,160,"BOUTON 2: GOMME"); call color(1); call grstrwrite(410,160,"BOUTON 2: STYLO"); call color(1) fi fi; call move(hs,vs); call getpress(1,h,v,p,l,r,c); if p=1 then exit fi od end souris; unit introduction : mouse procedure; var f:file, i,j,hg,vg,p,h,v:integer, l,r,c : boolean, figure:arrayof arrayof integer; begin array figure dim (1:35); for i:=1 to 35 do array figure(i) dim (1:72) od; open(f,integer,unpack("PRESENTATION")); call reset(f); for i:=1 to 35 do for j:=1 to 72 do get(f,figure(i,j)) od od; kill(f); call cls; call color(1); for j:=1 to 72 do for i:=1 to 35 do call move(360,30); hg:=((j-1)*10)+5;vg:=((i-1)*10)+5; if figure(i,j)=1 then call draw(hg-1,vg-1); call draw(hg+1,vg-1); call draw(hg+1,vg+1); call draw(hg-1,vg+1); call draw(hg-1,vg-1); call draw(hg,vg); call cirb(hg-5,vg-5,5,0,0,0,1,1,1); call cirb(hg-4,vg-4,4,0,0,0,1,1,1); call cirb(hg-3,vg-3,3,0,0,0,1,1,1); call cirb(hg-2,vg-2,2,0,0,0,1,1,1); call cirb(hg-1,vg-1,1,0,0,0,1,1,1); fi od od; call grstrwrite(110,40,"TOTAL Jaimie"); call grstrwrite(520,40,"SAINT-JEAN Patrick"); call grstrwrite(335,310,"CLIQUER"); call box(300,300,120,30,1); do call getpress(0,h,v,p,l,r,c); if p=1 then exit fi; call getpress(1,h,v,p,l,r,c); if p=1 then exit fi; call getpress(2,h,v,p,l,r,c); if p=1 then exit fi; od end introduction; unit presentation : procedure; begin call cls; call box(40,20,600,60,1); call box(42,22,596,56,1); call box(17,5,646,340,1); call box(20,8,640,295,1); call box(20,312,480,30,1); call grstrwrite(155,325,"R E S E A U N E U R O N A L"); call box(502,312,158,30,1); call grstrwrite(567,318,"TOTAL"); call grstrwrite(542,330,"SAINT - JEAN") end presentation; unit parties : procedure ( s:string ); begin call cls; call box(200,140,320,68,1); call grstrwrite(286,173,s); for i:=1 to 50000 do od; end; unit affichage : procedure ( num : integer ); var i,j:integer; begin case num when 1 : (* Presentation graphique de l'apprentissage : *) call presentation; call grstrwrite(135,45,"APPRENTISSAGE DES MOTIFS DE LA PREMIERE COUCHE"); call box(40,260,600,20,1); call grstrwrite(185,267,"niveau d'apprentissage de chaque motif"); (* Affichage du 1er motif *) call box(55,200,20,40,1); call box(49,129,32,32,1); call circles_in_box(1,50,130,3,motif(1)) when 2 : for i:=1 to 25000 do od; call presentation; call grstrwrite(120,45, "FIN DE L'APPRENTISSAGE DES MOTIFS DE LA PREMIERE COUCHE"); call grstrwrite(100,180, "Le reseau est a meme de reconnaitre l'ensemble de ces motifs"); for i:=1 to 100000 do od; when 3 : call presentation; call grstrwrite(225,45,"CONTROLE DES CONNAISSANCES"); when 4: (* Affichage des formes saisis *) call box(220,105,220,20,1); call grstrwrite(240,112,"FORME A RECONNAITRE ..."); call box(324,129,32,32,1); call circles_in_box(1,325,130,3,motif(1)); call box(180,170,310,20,1); call grstrwrite(200,176,"... PARMIS LES FORMES PRESENTEES"); call box(100,250,410,20,1); call grstrwrite(120,256,"... AVEC UN COEFFICIENT DE SELECTIVITE DE :"); call box(520,250,50,20,1); for i:=1 to 9 do (* Affichage des motifs *) call box(65*i-1,199,32,32,1); call circles_in_box(1,65*i,200,3,formes_test(i)) od; for i:=1 to 15000 do od when 5: call grintwrite(1,560,256,k_selectivite); for i:=1 to 4 do call box(518,248,54,24,1);call box(519,249,52,22,1); for k:=1 to 2000 do od; call box(518,248,54,24,0);call box(519,249,52,22,0); for k:=1 to 2000 do od od when 7 : for i:=1 to 30000 do od; call presentation; call grstrwrite(200,45,"CONCLUSIONS SUR LE TEST"); call grstrwrite(60,100, " Nous nous apercevons donc que, plus le coefficient de selectivite"); call grstrwrite(60,130, "augmente, et moins les formes sont considerees comme proche du modele"); call grstrwrite(60,160,"presente ."); call grstrwrite(60,190, "De plus, cela permet de supposer que le NEOCOGNITRON reconnait ( en"); call grstrwrite(60,220, "generalisant a tous les motifs de l'apprentissage ) des formes pro-"); call grstrwrite(60,250,"ches des modeles qui lui sont connus ."); call grstrwrite(60,280, " Choisissons la valeur du coefficient a partir de cette etude ..."); for i:=1 to 300000 do od; call presentation; call grstrwrite(140,45,"VISUALISATION GRAPHIQUE DES RESULTATS DU TEST") when 8 : (* Impression du graphique *) call graphique(tab_result,100,250,0,1,1.125,0.125,"K_SELECTIVITE", "NBE DE FORMES RECONNUES"); for i:=1 to 150000 do od; call box(300,100,320,40,1); call grstrwrite(340,110,"On choisira un coefficient de:"); call grstrwrite(340,125," 2.0"); for i:=1 to 150000 do od when 9 : call presentation; call grstrwrite(180,45,"APPLICATION A UN MOTIF PLUS COMPLEXE"); for i:=1 to 30000 do od; call presentation; call grstrwrite(200,45,"SAISIE DE LA FORME A LA SOURIS"); call souris; (* Saisie de la visualisation graphique du motif *) call move(117,87);tab_graph:=fenetre.getmap(313,295); (* Recherche des parties proche d'un des motifs connus de la 1ere couche *) call presentation; call grstrwrite(100,45, "RECHERCHE DE CHACUN DES MOTIFS SUR LA FORME PRESENTEE"); (* Mise en place graphique de la forme,du motif cherche sur la forme et de la matrice de sortie de la 1ere couche *) call move(90,87); call putmap(tab_graph); call box(400,97,176,188,1); call box(402,99,172,172,1); call grstrwrite(442,275,"SORTIE PLAN"); call box(303,166,80,60,1); call box(303,236,80,40,1); call grstrwrite(318,262,"CHERCHE"); call grstrwrite(325,245,"MOTIF"); call move(400,97); tab_graph:=getmap(576,285) when 10 : (* Superposition des 12 plans *) call presentation; call grstrwrite(50,45, "RECAPITULATIF DES SORTIES DES 12 PLANS DE NEURONES DE LA COUCHE"); (* Recapitulatif graphique des sorties de chacun des 12 plans *) for i:=1 to 12 do call move(225,97);call putmap(res_final(i)); for j:=1 to 3000 do od; call move(225,97);call putmap(tab_graph); od; for i:=1 to 20000 do od; call presentation; call grstrwrite(100,45, "SUPERPOSITION DES 12 PLANS DE SORTIE DE LA PREMIERE COUCHE"); for i:=1 to 15000 do od; (* Superposition des 12 plans *) for i:=1 to 12 do call move(225,97);call ormap(res_final(i)); for j:=1 to 5000 do od; od; for i:=1 to 50000 do od; call presentation; call grstrwrite(290,45,"CONCLUSIONS"); call grstrwrite(250,150, "ON OBTIENT BIEN LA FIGURE DONNEE"); call grstrwrite(200,200, "SEULEMENT A L'AIDE DE CES 12 MOTIFS ELEMENTAIRES"); for i:=1 to 100000 do od when 11 : call parties("P A R T I E A") when 12 : call parties("P A R T I E B") when 13 : call parties("P A R T I E C") when 14 : call parties(" F I N") esac end affichage; begin call gron(2);call border(0);call color(1); end ekran; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* Definition d'une matrice (n*n) *) unit mat : class (n : integer); var tab : arrayof arrayof real, i : integer; begin array tab dim (1:n); for i:=1 to n do array tab(i) dim (1:n) od; end mat; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* Definition du resultat du test presente apres l'apprentissage *) unit resultat_test : class; unit elem2 : class; var nb_rec : integer, forme : arrayof integer; begin array forme dim (1:9) end elem2; var i:integer, tab : arrayof elem2; begin array tab dim (1:10); for i:=1 to 10 do tab(i):=new elem2 od end resultat_test; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* Definition de la premiere couche *) unit tabcouche1 : class; unit elem : class; (* Matrice des poids du motif du plan considere *) var tpoids1 : mat; (* Valeur d'inhibition du motif *) var poidsinhibe1 : real; (* Sorties de la premiere couche *) var sortie1 : arrayof arrayof integer; end elem; (* structure de la table des neurones *) var plans1 : arrayof elem; (* Plans d'inhibition *) var distance1 : arrayof mat; (* Fichier contenant les valeurs de pre-initialisation de la matrice des distances *) var i,j: integer, c : char; (* initialisation des differentes tables *) begin (* La 1ere couche est constituee de 12 plans (12 motifs differents) *) array plans1 dim (1:12); (* initialisation des elements de la table des plans *) for i:=1 to 12 do plans1(i):= new elem; (* initialisation de la matrice des poids de chacun des 12 plans *) plans1(i).tpoids1 := new mat(3); (* initialisation de la valeur d'inhibition de chaque plan *) plans1(i).poidsinhibe1 := 0; (* initialisation de la table des neurones de la couche *) array plans1(i).sortie1 dim (1:17); for j:=1 to 17 do array plans1(i).sortie1(j) dim (1:17) od; od; (* Saisie de la matrice des distances , cette matrice est initialisee une fois pour toute . On observe une ponderation decroissante du centre vers l'exterieur. La matrice des distance est initialisee a des petites valeurs en la normant *) distance1 := saisie(1,"D"); call fenetre.cls; for i:=1 to 3 do for j:=1 to 3 do distance1(1).tab(i,j) := distance1(1).tab(i,j)/(2*SQRT(17)) od od end tabcouche1; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* Fonction de saisie de fichiers texte . Pour simplifier la saisie,le nom du fichier sera arrete a 1 seul caractere -----------------------------------------------------------------------------*) unit saisie : function (tail_tab : integer,nom_fic: string) : arrayof mat; var f:file, i,j,k : integer, c : char; begin (* ouverture du fichier contenant les motifs en lecture *) open(f,text,unpack(nom_fic)); (* Positionnement en debut de fichier *) call RESET(f); (* Initialisation du tableau des motifs : il y a tail_tab motifs differents ... *) array result dim (1:tail_tab); (* ... et chaque motif est constitue d'un tableau (3*3) de reels *) for k:=1 to tail_tab do result(k):=new mat(3) od; (* Remplissage de la table des motifs saisis *) for k:=1 to tail_tab do for i:=1 to 3 do for j:=1 to 3 do read(f,c);result(k).tab(i,j):=ord(c)-48 od od od; (* Fermeture fichier *) kill(f) end saisie; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* En plus d'initialiser la 1ere couche , cette coroutine effectue l'apprentissage des formes qui doivent etre connues . -----------------------------------------------------------------------------------------------------------------------*) unit ajuste_poids_1 : coroutine(nb_cor:integer); var i,j,k,t : integer, total,som_inhib : real, c : char, cor : ajuste_poids_1; begin (* initialisation du poids d'inhibition *) som_inhib:=0; for i:=1 to 3 do for j:=1 to 3 do som_inhib := som_inhib + (motif(nb_cor).tab(i,j)*couche.distance1(1).tab(i,j)) od od; som_inhib := SQRT(som_inhib); (* Creation de toutes les coroutines ,1 pour l'apprentissage de chacun des 12 motifs *) if nb_cor<12 then (* Creation de la coroutine d'apprentissage du motif (nb_cor + 1) *) cor:=new ajuste_poids_1(nb_cor+1); (* Affichage des motifs *) call fenetre.box(50*(nb_cor+1)+5,200,20,40,1); call fenetre.box(50*(nb_cor+1)-1,129,32,32,1); call fenetre.circles_in_box(1,50*(nb_cor+1),130,3,motif(nb_cor+1)); fi; return; t:=239; (* Apprentissage du motif nb_cor *) for k:=1 to 200 do (* Impression physique de la coroutine traitee *) call fenetre.box(50*nb_cor-3,127,36,36,1); (* Impression du pourcentage d'apprentissage *) if (k MOD 5)=0 then call fenetre.move(50*nb_cor+5,t); call fenetre.draw(50*nb_cor+25,t); t:=t-1 fi; (* On attend la fin de l'execution des coroutines suivantes *) if nb_cor<12 then attach(cor) fi; (* Renforcement des poids du motif etudie *) for i:=1 to 3 do for j:=1 to 3 do couche.plans1(nb_cor).tpoids1.tab(i,j) := couche.plans1(nb_cor).tpoids1.tab(i,j) + ( k_appr*motif(nb_cor).tab(i,j) * couche.distance1(1).tab(i,j) ); od od; (* calcul du poids d'inhibition *) couche.plans1(nb_cor).poidsinhibe1 := couche.plans1(nb_cor).poidsinhibe1 + k_appr*som_inhib; call fenetre.box(50*nb_cor-3,127,36,36,0); detach od end ajuste_poids_1; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) (* Cette coroutine effectue le traitement de la reconnaissance des motifs de la 1ere couche . Elle effectue 2 traitements : celui du test de fiabilite de la methode sur des formes simples , puis la reconnaissance de formes donnees plus complexes . -------------------------------------------------------------------------*) unit filtre : coroutine (num_essai,nb_cor,cor_traite,plan : integer); (* Cette fonction calcule la valeur de sortie d'un neurone de la couche *) unit calcul_sortie : function(forme : mat , plan_traite : integer):integer; var i,j : integer, valeur,som,som_inhib: real; begin som,som_inhib := 0; for i:=1 to 3 do for j:=1 to 3 do som:= som + forme.tab(i,j)*couche.plans1(plan_traite).tpoids1.tab(i,j); som_inhib := som_inhib + forme.tab(i,j)*couche.distance1(1).tab(i,j) od od; som_inhib := couche.plans1(plan_traite).poidsinhibe1*SQRT(som_inhib); (* Valeur de sortie du neurone considere *) valeur := (1 + som)/(1 + k_selectivite/(1 + k_selectivite)*som_inhib) - 1; if valeur>0 then result:=1 fi end calcul_sortie; var i1,i2,j1,j2 : integer, c : char, mat_traite,bidon : mat, cor : filtre; begin (* Creation des filtres correspondant au nombre de plans *) if (nb_cor>cor_traite) then cor := new filtre(num_essai,nb_cor,cor_traite+1,plan+1); fi; return; if (nb_cor>cor_traite) then attach(cor) fi; mat_traite := new mat(3); if nb_cor=12 then (* Formes compliquees *) (* Affichage du motif recherche sur la forme proposee *) call fenetre.box(328,180,32,32,1); call fenetre.circles_in_box(1,329,181,3,motif(cor_traite)); (* Creation d'une matrice d'entiers bidon de taille 1 afin d'utiliser la fonction 'circle_in_box' *) bidon:=new mat(1); for i1:=1 to 17 do for j1:=1 to 17 do for i2:=1 to 3 do for j2:=1 to 3 do mat_traite.tab(i2,j2) := forme.tab(i1+i2-1,j1+j2-1) od od; if calcul_sortie(mat_traite,plan)=1 then couche.plans1(plan).sortie1(i1,j1) := 1; bidon.tab(1,1):=1; for i2:=1 to 3 do call fenetre.circles_in_box(0,83+(j1*10),80+(i1*10),3,mat_traite); call fenetre.circles_in_box(1,83+(j1*10),80+(i1*10),3,mat_traite); od; call fenetre.circles_in_box(1,393+(j1*10),90+(i1*10),1,bidon) fi; od od; for i1:=1 to 30000 do od; (* Sauvegarde graphique de la matrice de sortie du plan traite *) call fenetre.move(400,97);res_final(cor_traite):=fenetre.getmap(576,285); (* Nettoyage graphique de la matrice de sortie du plan 'cor_traite' *) call fenetre.move(400,97); call fenetre.putmap(tab_graph) else (* Formes simples du fichier de test *) mat_traite := formes_test(plan); if calcul_sortie(mat_traite,plan)=1 then (* Nombre de formes considerees comme proche du 1er motif (celui presente) par le reseau *) resultat.tab(num_essai).nb_rec := resultat.tab(num_essai).nb_rec + 1; (* Permet de savoir si la forme nb_cor du jeu de test est consideree comme proche du 1er motif *) resultat.tab(num_essai).forme(cor_traite):=1 fi; fi; detach end filtre; (*------------------------------------------------------------------------------------------------------------------------------------------------------------------*) var c : char, k_selectivite : real, i,j,k,k_appr : integer, tab_result,tab_graph : arrayof integer, res_final : arrayof arrayof integer, resultat : resultat_test, forme : mat, motif,formes_test : arrayof mat, apprend : ajuste_poids_1, verif,chercher : filtre, couche : tabcouche1, fenetre : ekran; (*------------------------------------------------------------------ Programme principal ---------------------------------------------------------------------------*) begin (* les constantes d'apprentissage et de selectivite des formes sont fixees arbitrairement *) k_appr := 10; write(chr(27),"[2J",chr(27),"[H"); (* ouverture d'une fenetre *) fenetre := new ekran; call fenetre.introduction; (* Saisie de la table des motifs *) motif := saisie(12,"M"); (* Creation de la premiere couche *) couche := new tabcouche1; (*------------------------------------------- Phases d'initialisation de la 1ere couche et apprentissage des motifs ---------------------------------------------*) call fenetre.affichage(11); call fenetre.affichage(1); apprend := new ajuste_poids_1(1); for i:=1 to 200 do attach(apprend) od; call fenetre.affichage(2); (*------------------------------------------------------------------- Filtrage des formes ----------------------------------------------------------------------*) (*------------------------------------------- D'abord ,on verifie la methode sur des exemples simples -----------------------------------------------------*) call fenetre.affichage(12); call fenetre.affichage(3); (* Saisie du fichier contenant les formes simples *) formes_test := saisie(9,"T"); call fenetre.affichage(4); (* Verification de la methode et modulation du coefficient de selectivite, afin de montrer que plus le coefficient est important et plus les formes reconnus sont proches du motif recherche *) (* Creation de la matrice des resultats *) resultat:=new resultat_test; for j:=1 to 10 do k_selectivite:=1+j/8; call fenetre.affichage(5); verif := new filtre(j,9,1,1); attach(verif); (* Presentation du resultat avec ce coefficient de selectivite k_selectivite *) for i:=1 to 9 do if resultat.tab(j).forme(i)=1 then call fenetre.box( (65*i)-2,198,34,34,1); call fenetre.box( (65*i)-3,197,36,36,1) fi od; for i:=1 to 30000 do od; call fenetre.grintwrite(0,560,256,k_selectivite); for i:=1 to 9 do if resultat.tab(j).forme(i)=1 then call fenetre.box( (65*i)-2,198,34,34,0); call fenetre.box( (65*i)-3,197,36,36,0) fi od od; call fenetre.affichage(7); (* Recuperation des resultats dans une table d'entiers *) array tab_result dim(1:10); for i:=1 to 10 do tab_result(i):=resultat.tab(i).nb_rec; od; call fenetre.affichage(8); (*------------------------------------------------ Application a un motif plus complexe ----------------------------------*) (* Creation de la retine *) forme := new mat(19); call fenetre.affichage(13); call fenetre.affichage(9); (* Creation matrice des resultats pour affichage final *) array res_final dim (1:12); (* Mise en place de la reconnaissance des 12 motifs dans la forme proposee *) chercher := new filtre(1,12,1,1); k_selectivite := 2; attach(chercher); call fenetre.affichage(10); call fenetre.affichage(14); (* Fermeture de la fenetre *) call fenetre.groff; end RESNEURONAL;