Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
8156 connectés 

 


 Mot :   Pseudo :  
  Aller à la page :
 
 Page :   1  2  3  4  5  ..  21275  21276  21277  ..  35624  35625  35626  35627  35628  35629
Auteur Sujet :

[Topic Insomniaks] Il est entre 1h et 7h du mat' et tu erres? Entre...

n°19520180
AngX
bleu 485
Posté le 16-08-2009 à 05:46:31  profilanswer
 

Reprise du message précédent :
taggle :o


---------------
#MarcheFort
mood
Publicité
Posté le 16-08-2009 à 05:46:31  profilanswer
 

n°19520182
totoz
( ͡° ͜ʖ ͡°) KK ( ͡⊙ ͜ʖ ͡⊙)
Posté le 16-08-2009 à 05:50:46  profilanswer
 

VG


---------------
InstaKAKAgram▲La bouffe de Totoz▲Steam▲BattleTag: Totoz#1835
n°19520183
Profil sup​primé
Posté le 16-08-2009 à 05:52:58  answer
 

Citation :

   Enter Choice:  2
Enter filname of MIDI file : test/Hello.mid
 
Please, wait !  
......................................................................................................................................................................................................
Load artificial neural network
Epoch 111. => RMS_Error:  3.53704593590199312E-03


 
What else?

n°19520184
AngX
bleu 485
Posté le 16-08-2009 à 05:53:01  profilanswer
 

va manger ton cassoulet toi :o


---------------
#MarcheFort
n°19520185
Profil sup​primé
Posté le 16-08-2009 à 05:54:48  answer
 

Les informaticien ne mange pas de quiche !  :o

n°19520186
AngX
bleu 485
Posté le 16-08-2009 à 05:55:22  profilanswer
 

nan mais l'autre con pas toi :o


---------------
#MarcheFort
n°19520188
Profil sup​primé
Posté le 16-08-2009 à 06:00:09  answer
 

Code :
  1. with Text_Io;
  2. use Text_Io;
  3. with Midi, Midi.File;
  4. use Midi, Midi.File;
  5.  
  6. with PragmARC.REM_NN_Wrapper;
  7. use PragmARC.REM_NN_Wrapper;
  8. with PragmARC.ANSI_TTY_Control;
  9. with PragmARC.Math.Functions;
  10. package body Midi_Engine is
  11.  
  12.  
  13.   Harmonie_Hex : constant String := "harmonie.hex";
  14.   Harmonie_Flt : constant String := "harmonie.flt";
  15.  
  16.   package Real_Io is new Text_Io.Float_Io(Real);
  17.   package Real_Math is new PragmARC.Math.Functions (Supplied_Real => Real);
  18.  
  19.  
  20.   procedure Get_Input (Pattern : in Positive;
  21.                        Input : out Node_Set;
  22.                        Desired : out Node_Set) is
  23.      File : File_Type;
  24.   begin
  25.      Open(File, In_File, Harmonie_Flt);
  26.      for I in 1..Pattern loop
  27.         for I in Input'range loop
  28.            Real_Io.Get(File, Input(I));
  29.         end loop;
  30.         for I in Input'range loop
  31.            Real_Io.Get(File, Desired(I));
  32.         end loop;
  33.         Put('.');
  34.      end loop;
  35.      Close(File);
  36.   end Get_Input;
  37.  
  38.  
  39.   procedure Initialize is
  40.      Char : Character;
  41.      Data_Length : constant := 1;
  42.      File : File_Type;
  43.   begin
  44.      loop
  45.         Put("Are you sure you want do this? (y/n) : " );
  46.         Get_Immediate(Char);
  47.         case Char is
  48.            when 'Y' | 'y' =>
  49.               Create(file, Out_File, Harmonie_flt);
  50.               for J in 1..24 loop
  51.                  Real_Io.put(File, 0.0);
  52.               end loop;
  53.               for J in 1..24 loop
  54.                  Real_Io.put(File, 0.0);
  55.               end loop;
  56.               Close(File);
  57.               declare
  58.                  package Harmonie_REM_NN_init is new REM_NN(Num_Input_Nodes => 24,
  59.                                                             Num_Hidden_Nodes => 24,
  60.                                                             Num_Output_Nodes => 24,
  61.                                                             New_Random_Weights => True,
  62.                                                             Input_To_Output_Connections => False,
  63.                                                             Num_Patterns => Data_length,
  64.                                                             Get_Input => Get_Input);
  65.                  Converged  : float :=     0.002;
  66.                  Response : Harmonie_REM_NN_Init.Output_Set := (others => 0.0);
  67.                  Desired_Output : array (1..Data_Length) of Harmonie_REM_NN_init.Output_Set;
  68.  
  69.                  RMS_Error : Real := 0.0;
  70.                  Error     : Real := 0.0;
  71.  
  72.               begin
  73.                  Desired_Output :=(others => (others => 0.0));
  74.                  Open(File, In_File, Harmonie_flt);
  75.                  for I in 1..Data_Length loop
  76.                     for J in Harmonie_REM_NN_init.Output_Set'range loop
  77.                        Real_Io.Get(File, Desired_output(I)(J));
  78.  
  79.                     end loop;
  80.                     for J in Harmonie_REM_NN_init.Output_Set'range loop
  81.                        Real_Io.Get(File, Desired_output(I)(J));
  82.                     end loop;
  83.                  end loop;
  84.                  Close(File);
  85.              All_Patterns :
  86.                  for Pattern in 1..Data_length loop
  87.                     Harmonie_REM_NN_init.Respond (Pattern, Response);
  88.                     Harmonie_REM_NN_init.Train;
  89.                     for I in Response'Range loop
  90.                        Error := Error + (Desired_Output(Pattern)(i) -   Response(i) );
  91.                     end loop;
  92.                     RMS_Error := RMS_Error + ((Error/Real(Response'Length)) ** 2);
  93.                     Error := 0.0;
  94.                  end loop All_Patterns;
  95.                  Put(" => RMS_Error: " );
  96.                  RMS_Error := Real_Math.Sqrt(RMS_Error / Real (Data_length)) ;
  97.                  Real_Io.Put(RMS_Error);
  98.                  Harmonie_REM_NN_init.Save_Weights;
  99.               end;
  100.               exit;
  101.            when 'N' | 'n' =>
  102.               exit;
  103.            when others =>
  104.               null;
  105.         end case;
  106.      end loop;
  107.      null;
  108.   end Initialize;
  109.  
  110.   procedure Print(S : String) is
  111.      File : File_Type;
  112.  
  113.   begin
  114.      begin
  115.         Open(File, append_File, Harmonie_Hex);
  116.      exception
  117.         when Name_Error =>
  118.            Create(File, out_File,Harmonie_Hex);
  119.      end;
  120.      Put_Line(File, S);
  121.      Close(File);
  122.   end Print;
  123.  
  124.   Log_Out : Log_Out_Function := Print'Access;
  125.   procedure Dump is new Dump_To_Screen(Log_Out);
  126.   Dump_Ptr : Event_Handler := Dump'Access;
  127.  
  128.   procedure Load_File is
  129.      Line : String(1..256);
  130.      Last : Natural;
  131.      File : Midifile;
  132.      Hex, Flt : File_Type;
  133.      Current_Chunk : aliased Chunk;
  134.      Data_Length : Natural := 1;
  135.   begin
  136.      Put("Enter filname of MIDI file : " );
  137.      Get_Line(Line, Last);
  138.      if Last /= 0 then
  139.         File := Read(Line(1..Last));
  140.         for I in 1..GetTrackCount(File) loop
  141.            Current_Chunk := GetChunk(File, I);
  142.            parse(Current_Chunk, Dump'access);
  143.            New_Line;
  144.         end loop;
  145.      end if;
  146.      Put_Line("Please, wait ! " );
  147.      Open(Hex, In_File, Harmonie_hex);
  148.      while not End_Of_File(Hex) loop
  149.         Get_Line(Hex, Line, Last);
  150.         case Line(2) is
  151.            when 'i' => -- Midi Event
  152.               null;
  153.            when 'e' => -- Metat Event
  154.               null;
  155.            when '-' => -- Tic
  156.               null;
  157.            when others => -- Value
  158.               null;
  159.         end case;
  160.         Put('.');
  161.      end loop;
  162.      New_Line;
  163.      Put("Load artificial neural network" );
  164.      New_Line;
  165.      declare
  166.         package Harmonie_REM_NN_Expl is new REM_NN(Num_Input_Nodes => 24,
  167.                                                   Num_Hidden_Nodes => 24,
  168.                                                   Num_Output_Nodes => 24,
  169.                                                   New_Random_Weights => false,
  170.                                                   Input_To_Output_Connections => False,
  171.                                                   Num_Patterns => Data_length,
  172.                                                   Get_Input => Get_Input);
  173.         Converged  : float :=     0.002;
  174.         Response : Harmonie_REM_NN_Expl.Output_Set := (others => 0.0);
  175.         Desired_Output : array (1..Data_Length) of Harmonie_REM_NN_expl.Output_Set;
  176.  
  177.         RMS_Error : Real := 0.0;
  178.  
  179.         Error     : Real := 0.0;
  180.  
  181.         Max_Epochs : Positive := 10000;
  182.         Epoch : Natural := 0;
  183.      begin
  184.         loop
  185.  
  186.            Put (PragmARC.ANSI_TTY_Control.Position (29, 1) );
  187.            Put ("Epoch" );
  188.            put (Integer'Image (Epoch) );
  189.  
  190.        All_Patterns :
  191.            for Pattern in 1..Data_length loop
  192.               Harmonie_REM_NN_Expl.Respond (Pattern, Response);
  193.               Harmonie_REM_NN_Expl.Train;
  194.               for I in Response'Range loop
  195.                  Error := Error + (Desired_Output(Pattern)(i) -   Response(i) );
  196.               end loop;
  197.               RMS_Error := RMS_Error + ((Error/Real(Response'Length)) ** 2);
  198.               Error := 0.0;
  199.            end loop All_Patterns;
  200.            Put(" => RMS_Error: " );
  201.            RMS_Error := Real_Math.Sqrt(RMS_Error / Real (Data_length)) ;
  202.            Real_Io.Put(RMS_Error);
  203.            if (RMS_Error < Real(Converged)) or
  204.              (Epoch > Max_Epochs) then
  205.               exit;
  206.            end if;
  207.            RMS_Error := 0.0;
  208.            Epoch := Epoch + 1;
  209.         end loop;
  210.         Harmonie_REM_NN_expl.Save_Weights;
  211.      end;
  212.   exception
  213.      when Name_Error =>
  214.         null;
  215.   end Load_File;
  216.  
  217.   procedure Run is
  218.  
  219.   begin
  220.  
  221.  
  222.      null;
  223.   end Run;
  224.  
  225. end Midi_Engine;


 
[:jovalise]

n°19520190
grande dam​e
Posté le 16-08-2009 à 06:01:47  profilanswer
 

AngX a écrit :

nan mais l'autre con pas toi :o


Stoi le con :o

n°19520194
Profil sup​primé
Posté le 16-08-2009 à 06:06:23  answer
 

mERDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

n°19520197
grande dam​e
Posté le 16-08-2009 à 06:07:04  profilanswer
 

:sweat:

mood
Publicité
Posté le 16-08-2009 à 06:07:04  profilanswer
 

n°19520198
potemkin
Optimisateur relativiste.
Posté le 16-08-2009 à 06:07:31  profilanswer
 


 [:space]

n°19520199
amdvsintel
Posté le 16-08-2009 à 06:08:14  profilanswer
 

Pathétique ce topic :/

n°19520202
grande dam​e
Posté le 16-08-2009 à 06:09:18  profilanswer
 

amdvsintel a écrit :

Pathétique ce topic :/


Comme toi en fait  [:cmshadow]

n°19520203
potemkin
Optimisateur relativiste.
Posté le 16-08-2009 à 06:09:22  profilanswer
 

amdvsintel a écrit :

Pathétique ce topic :/


"Ce soir, c'était onze hommes contre onze enfants."

n°19520206
grande dam​e
Posté le 16-08-2009 à 06:11:11  profilanswer
 


 [:nobody-home]

n°19520208
AngX
bleu 485
Posté le 16-08-2009 à 06:12:30  profilanswer
 

taggle


---------------
#MarcheFort
n°19520209
grande dam​e
Posté le 16-08-2009 à 06:14:09  profilanswer
 


nop  :sweat:

n°19520211
AngX
bleu 485
Posté le 16-08-2009 à 06:18:39  profilanswer
 

ben si pourtant il faut :/


---------------
#MarcheFort
n°19520215
grande dam​e
Posté le 16-08-2009 à 06:22:46  profilanswer
 

AngX a écrit :

ben si pourtant il faut :/


Google it: karcher
 [:sarko]

n°19520216
Profil sup​primé
Posté le 16-08-2009 à 06:28:00  answer
 

J'ai pas l'heure.  :o

n°19520217
zeuartisan
Lefilpoupre dans la bibli.
Posté le 16-08-2009 à 06:28:11  profilanswer
 

http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
http://images.ashots.org/vomi.jpghttp://images.ashots.org/vomi.jpg
 
Nuit de merde.


---------------
https://www.youtube.com/watch?v=eviqX3QXd-s - Hugo TSR : La haut
n°19520219
Neo_XP
Dawa'z addict
Posté le 16-08-2009 à 06:30:59  profilanswer
 

:dtc:


---------------
Mais ouais
n°19520221
AngX
bleu 485
Posté le 16-08-2009 à 06:31:42  profilanswer
 

[:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]  [:am72]


---------------
#MarcheFort
n°19520222
AngX
bleu 485
Posté le 16-08-2009 à 06:32:08  profilanswer
 

[:dodo]


---------------
#MarcheFort
n°19520223
grande dam​e
Posté le 16-08-2009 à 06:35:45  profilanswer
 

:o

n°19520224
Neo_XP
Dawa'z addict
Posté le 16-08-2009 à 06:39:24  profilanswer
 

o:


---------------
Mais ouais
n°19520226
knahos
Question Reality...
Posté le 16-08-2009 à 06:43:24  profilanswer
 

[:kaman]


---------------
Not my place in time, not my place in space.
n°19520227
totoz
( ͡° ͜ʖ ͡°) KK ( ͡⊙ ͜ʖ ͡⊙)
Posté le 16-08-2009 à 06:44:07  profilanswer
 
n°19520231
Neo_XP
Dawa'z addict
Posté le 16-08-2009 à 06:57:32  profilanswer
 

bonne journée, à ce soir :o


---------------
Mais ouais
n°19520232
Profil sup​primé
Posté le 16-08-2009 à 06:58:05  answer
 

Code :
  1. -- Program name : harmonie ; -- Description : Ordonnanceur.    -- Copyright © 2009 Manuel De Girardi
  2.  
  3.    -- Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier au titre
  4.    -- des clauses de la Licence Publique Générale GNU, telle que publiée par la Free
  5.    --Software Foundation ; soit la version 2 de la Licence, ou (à  votre discrétion) une version
  6.    --ultérieure quelconque. Ce programme est distribué dans l'espoir qu'il sera utile, mais
  7.    --SANS AUCUNE GARANTIE ; sans même une garantie implicite de COMMERCIABILITE
  8.    --ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. Voir la Licence Publique
  9.    --Générale GNU pour plus de détails. Vous devriez avoir reçu un exemplaire de la Licence
  10.    --Publique Générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à  la Free
  11.    --Software Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  12.  
  13. -------------------------------------------------------------------------------
  14. -- Author      : Manuel De Girardi
  15. -- Date        : 2009/08/13
  16. -- Version     : 0.0.0-1a
  17. -- Description : Compositeur-intepreteur de musique automatique.
  18. -------------------------------------------------------------------------------
  19.  
  20.  
  21. with Ada.Characters.Handling;
  22. with Ada.Characters.Latin_1;
  23. with Ada.Strings, Ada.Strings.Fixed;
  24. with Pragmarc.Ansi_Tty_Control;
  25. with Calendar, Time_To_Date;
  26. with Ada.Integer_Text_Io;
  27.  
  28.  
  29.  
  30. use Ada.Characters;
  31. use Ada.Characters.Handling;
  32. use Ada.Strings, Ada.Strings.Fixed;
  33. use Pragmarc.Ansi_Tty_Control;
  34. use Calendar, Time_To_Date;
  35. use Ada.Integer_Text_Io;
  36.  
  37. with Text_Io;
  38. use Text_Io;
  39. with Midi, Midi.File;
  40. use Midi, Midi.File;
  41.  
  42. with PragmARC.REM_NN_Wrapper;
  43. use PragmARC.REM_NN_Wrapper;
  44. with PragmARC.ANSI_TTY_Control;
  45. with PragmARC.Math.Functions;
  46.  
  47. with Ada.Characters;
  48. use Ada.Characters;
  49. with Ada.Characters.Latin_1;
  50.  
  51. with Message;
  52. with Text_Io;
  53. with Portmidi, Porttime;
  54. with System;
  55. use Message;
  56. use Text_Io;
  57. use Portmidi, Porttime;
  58. use System;
  59.  
  60. with Musician, Partition, Midi_Implementation;
  61. use Musician, Partition, Midi_Implementation;
  62.  
  63. package body Midi_Engine is
  64.  
  65.  
  66.   Harmonie_Hex : constant String := "harmonie.hex";
  67.   Harmonie_Flt : constant String := "harmonie.flt";
  68.  
  69.   package Real_Io is new Text_Io.Float_Io(Real);
  70.   package Real_Math is new PragmARC.Math.Functions (Supplied_Real => Real);
  71.  
  72.  
  73.   procedure Get_Input (Pattern : in Positive;
  74.                        Input : out Node_Set;
  75.                        Desired : out Node_Set) is
  76.      File : File_Type;
  77.   begin
  78.      Open(File, In_File, Harmonie_Flt);
  79.      for I in 1..Pattern loop
  80.         for I in Input'range loop
  81.            Real_Io.Get(File, Input(I));
  82.         end loop;
  83.         for I in Input'range loop
  84.            Real_Io.Get(File, Desired(I));
  85.         end loop;
  86.         Put('.');
  87.      end loop;
  88.      Close(File);
  89.   end Get_Input;
  90.  
  91.  
  92.   procedure Initialize is
  93.      Char : Character;
  94.      Data_Length : constant := 1;
  95.      File : File_Type;
  96.   begin
  97.      loop
  98.         Put("Are you sure you want do this? (y/n) : " );
  99.         Get_Immediate(Char);
  100.         case Char is
  101.            when 'Y' | 'y' =>
  102.               Create(file, Out_File, Harmonie_flt);
  103.               for J in 1..24 loop
  104.                  Real_Io.put(File, 0.0);
  105.               end loop;
  106.               for J in 1..24 loop
  107.                  Real_Io.put(File, 0.0);
  108.               end loop;
  109.               Close(File);
  110.               declare
  111.                  package Harmonie_REM_NN_init is new REM_NN(Num_Input_Nodes => 24,
  112.                                                             Num_Hidden_Nodes => 24,
  113.                                                             Num_Output_Nodes => 24,
  114.                                                             New_Random_Weights => True,
  115.                                                             Input_To_Output_Connections => False,
  116.                                                             Num_Patterns => Data_length,
  117.                                                             Get_Input => Get_Input);
  118.                  Converged  : float :=     0.002;
  119.                  Response : Harmonie_REM_NN_Init.Output_Set := (others => 0.0);
  120.                  Desired_Output : array (1..Data_Length) of Harmonie_REM_NN_init.Output_Set;
  121.  
  122.                  RMS_Error : Real := 0.0;
  123.  
  124.                  Error     : Real := 0.0;
  125.  
  126.               begin
  127.                  Desired_Output :=(others => (others => 0.0));
  128.                  Open(File, In_File, Harmonie_flt);
  129.                  for I in 1..Data_Length loop
  130.                     for J in Harmonie_REM_NN_init.Output_Set'range loop
  131.                        Real_Io.Get(File, Desired_output(I)(J));
  132.  
  133.                     end loop;
  134.                     for J in Harmonie_REM_NN_init.Output_Set'range loop
  135.                        Real_Io.Get(File, Desired_output(I)(J));
  136.                     end loop;
  137.                  end loop;
  138.                  Close(File);
  139.              All_Patterns :
  140.                  for Pattern in 1..Data_length loop
  141.                     Harmonie_REM_NN_init.Respond (Pattern, Response);
  142.                     Harmonie_REM_NN_init.Train;
  143.                     for I in Response'Range loop
  144.                        Error := Error + (Desired_Output(Pattern)(i) -   Response(i) );
  145.                     end loop;
  146.                     RMS_Error := RMS_Error + ((Error/Real(Response'Length)) ** 2);
  147.                     Error := 0.0;
  148.                  end loop All_Patterns;
  149.                  Put(" => RMS_Error: " );
  150.                  RMS_Error := Real_Math.Sqrt(RMS_Error / Real (Data_length)) ;
  151.                  Real_Io.Put(RMS_Error);
  152.                  Harmonie_REM_NN_init.Save_Weights;
  153.               end;
  154.               exit;
  155.            when 'N' | 'n' =>
  156.               exit;
  157.            when others =>
  158.               null;
  159.         end case;
  160.      end loop;
  161.      null;
  162.   end Initialize;
  163.  
  164.   procedure Print(S : String) is
  165.      File : File_Type;
  166.  
  167.   begin
  168.      begin
  169.         Open(File, append_File, Harmonie_Hex);
  170.      exception
  171.         when Name_Error =>
  172.            Create(File, out_File,Harmonie_Hex);
  173.      end;
  174.      Put_Line(File, S);
  175.      Close(File);
  176.   end Print;
  177.  
  178.   Log_Out : Log_Out_Function := Print'Access;
  179.   procedure Dump is new Dump_To_Screen(Log_Out);
  180.   Dump_Ptr : Event_Handler := Dump'Access;
  181.  
  182.   procedure Load_File is
  183.      Line : String(1..256);
  184.      Last : Natural;
  185.      File : Midifile;
  186.      Hex, Flt : File_Type;
  187.      Current_Chunk : aliased Chunk;
  188.      Data_Length : Natural := 1;
  189.  
  190.   begin
  191.      Put("Enter filname of MIDI file : " );
  192.      Get_Line(Line, Last);
  193.      if Last /= 0 then
  194.         File := Read(Line(1..Last));
  195.         for I in 1..GetTrackCount(File) loop
  196.            Current_Chunk := GetChunk(File, I);
  197.            parse(Current_Chunk, Dump'access);
  198.            New_Line;
  199.         end loop;
  200.      end if;
  201.      Put_Line("Please, wait ! " );
  202.      Open(Hex, In_File, Harmonie_hex);
  203.      while not End_Of_File(Hex) loop
  204.         Get_Line(Hex, Line, Last);
  205.         case Line(2) is
  206.            when 'i' => -- Midi Event
  207.               null;
  208.            when 'e' => -- Metat Event
  209.               null;
  210.            when '-' => -- Tic
  211.               null;
  212.            when others => -- Value
  213.               null;
  214.         end case;
  215.         Put('.');
  216.      end loop;
  217.      Close(Hex);
  218.      New_Line;
  219.      Put("Load artificial neural network" );
  220.      New_Line;
  221.      declare
  222.         package Harmonie_REM_NN_Trai is new REM_NN(Num_Input_Nodes => 24,
  223.                                                   Num_Hidden_Nodes => 24,
  224.                                                   Num_Output_Nodes => 24,
  225.                                                   New_Random_Weights => false,
  226.                                                   Input_To_Output_Connections => False,
  227.                                                   Num_Patterns => Data_length,
  228.                                                   Get_Input => Get_Input);
  229.         Converged  : float :=     0.002;
  230.         Response : Harmonie_REM_NN_Trai.Output_Set := (others => 0.0);
  231.         Desired_Output : array (1..Data_Length) of Harmonie_REM_NN_trai.Output_Set;
  232.  
  233.         RMS_Error : Real := 0.0;
  234.  
  235.         Error     : Real := 0.0;
  236.  
  237.         Max_Epochs : Positive := 10000;
  238.         Epoch : Natural := 0;
  239.      begin
  240.         loop
  241.  
  242.            Put (PragmARC.ANSI_TTY_Control.Position (29, 1) );
  243.            Put ("Epoch" );
  244.            put (Integer'Image (Epoch) );
  245.  
  246.        All_Patterns :
  247.            for Pattern in 1..Data_length loop
  248.               Harmonie_REM_NN_Trai.Respond (Pattern, Response);
  249.               Harmonie_REM_NN_Trai.Train;
  250.               for I in Response'Range loop
  251.                  Error := Error + (Desired_Output(Pattern)(i) -   Response(i) );
  252.               end loop;
  253.               RMS_Error := RMS_Error + ((Error/Real(Response'Length)) ** 2);
  254.               Error := 0.0;
  255.            end loop All_Patterns;
  256.            Put(" => RMS_Error: " );
  257.            RMS_Error := Real_Math.Sqrt(RMS_Error / Real (Data_length)) ;
  258.            Real_Io.Put(RMS_Error);
  259.            if (RMS_Error < Real(Converged)) or
  260.              (Epoch > Max_Epochs) then
  261.               exit;
  262.            end if;
  263.            RMS_Error := 0.0;
  264.            Epoch := Epoch + 1;
  265.         end loop;
  266.         Harmonie_REM_NN_trai.Save_Weights;
  267.      end;
  268.   exception
  269.      when Name_Error =>
  270.         null;
  271.   end Load_File;
  272.  
  273.  
  274.  
  275.  
  276.  
  277.   procedure Run is
  278.      type T_Register is array (1..24) of Real;
  279.      Register : T_Register := (others => 0.0);
  280.      Prob_File : File_Type;
  281.      prob_Filename : constant String := "harmonie.flt";
  282.  
  283.  
  284.  
  285.      procedure Get_Input (Pattern : in Positive;
  286.                           Input : out Node_Set;
  287.                           Desired : out Node_Set) is
  288.         File : File_Type;
  289.  
  290.      begin
  291.         Open(File, In_File, prob_Filename);
  292.         for I in 1..Pattern loop
  293.            for I in Input'range loop
  294.               Real_Io.Get(File, Input(I));
  295.            end loop;
  296.         end loop;
  297.         Close(File);
  298.         Desired := (others => Real(0.0));
  299.      end Get_Input;
  300.  
  301.      Clear_Screen : constant String := Latin_1.Esc & "[;H" & Latin_1.Esc & "[2J";
  302.  
  303.  
  304.  
  305.  
  306.   task Harmonie is
  307.      entry Start;
  308.      entry Receive(Char : in Character);
  309.      entry Halt;
  310.   end Harmonie;
  311.  
  312.  
  313.   task Compositor is
  314.      entry Initialize;
  315.      entry Start;
  316.      entry Stop;
  317.      entry Halt;
  318.   end Compositor;
  319.  
  320.   type T_Orchester is array (Positive range <> ) of T_Musician;
  321.  
  322.   Orchester : T_Orchester(1..1);
  323.  
  324.  
  325.   type T_Oeuvre is array(1..Orchester'Length) of T_Partition;
  326.  
  327.  
  328.   task body Compositor is
  329.      End_Of_Task : Boolean := False;
  330.      Entract : Boolean := False;
  331.  
  332.      Pt_Error : PtError;
  333.      Pm_Error : PmError;
  334.      Resolution : Integer := 1;
  335.      PtCallback,
  336.      UserData : System.Address := Null_Address;
  337.  
  338.  
  339.  
  340.  
  341.      Oeuvre : T_Oeuvre;
  342.   begin
  343.      Pt_Error := Pt_Start(Resolution, PtCallback, UserData);
  344.      Pm_Error := Pm_Initialize;
  345.      Oeuvre(1) := (5, new T_Staff(1..256));
  346.      Oeuvre(1).Staff(1) := Bank_Select_MSB(15, 0);
  347.      Oeuvre(1).Staff(2) := Bank_Select_LSB(15, 0);
  348.      Oeuvre(1).Staff(3) := Program_change(15,0);
  349.      Oeuvre(1).Staff(4) := Note_On(0, 60, 100);
  350.      Oeuvre(1).Staff(5) := Note_off(0, 60);
  351.      accept Initialize do
  352.         Orchester(1).Initialize(6);
  353.         for I in Orchester'Range loop
  354.            Orchester(I).adjust(Oeuvre(I));
  355.         end loop;
  356.      end Initialize;
  357.      while not End_Of_Task loop
  358.         accept Start do
  359.            for I in Orchester'Range loop
  360.               Orchester(I).start;
  361.            end loop;
  362.            Entract := False;
  363.         end Start;
  364.         loop
  365.            select
  366.               accept Stop do
  367.                  for I in Orchester'Range loop
  368.                     Oeuvre(I) := (3, new T_Staff(1..256));
  369.                     Oeuvre(I).Staff(1) := NRPM_MSB(15, 0);
  370.                     Oeuvre(I).Staff(2) := NRPM_LSB(15, 2);
  371.                     Oeuvre(I).Staff(3) := Data_Entry_MSB(15,0);
  372.                  end loop;
  373.                  for I in Orchester'Range loop
  374.                     Orchester(I).receive(Oeuvre(I));
  375.                  end loop;
  376.                  delay 1.0;
  377.                  for I in Orchester'Range loop
  378.                     Orchester(I).Stop;
  379.                  end loop;
  380.                  Entract := True;
  381.               end Stop;
  382.            or
  383.               accept Halt do
  384.                  if Entract then
  385.                     for I in Orchester'Range loop
  386.                        Put("Compositor::START" );
  387.                        Orchester(I).start;
  388.                     end loop;
  389.                  end if;
  390.                  for I in Orchester'Range loop
  391.                     Put("Compositor::HALT" );
  392.                     Orchester(I).Halt;
  393.                  end loop;
  394.                  Entract := True;
  395.                  End_Of_Task := True;
  396.               end Halt;
  397.            or
  398.               delay 0.0;
  399.  
  400.  
  401.  
  402.  
  403.               declare
  404.                  package Harmonie_REM_NN_Expl is new REM_NN
  405.                    (Num_Input_Nodes => T_Register'length,
  406.                     Num_Hidden_Nodes => T_Register'length,
  407.                     Num_Output_Nodes => T_Register'length,
  408.                     Input_To_Output_Connections => False,
  409.                     New_Random_Weights => False,
  410.                     Num_Patterns => 1,
  411.                     Get_Input => Get_Input);
  412.  
  413.  
  414.  
  415.                  Response : Harmonie_REM_NN_Expl.Output_Set;
  416.               begin
  417.                  Harmonie_REM_NN_Expl.Respond (1, Response);
  418.                  for I in response'range loop
  419.               Register(i) := Real(Response(i));
  420.                  end loop;
  421.  
  422.                  for I in Register'Range loop
  423.                     if Register(I) >= -0.250 and Register(I) < 0.250 then
  424.                        Register(I) := 0.0;
  425.                     elsif Register(I) >= 0.750 and Register(I) < 1.250 then
  426.                        Register(I) := 1.0;
  427.                     end if;
  428.                  end loop;
  429.               end;
  430.            end select;
  431.            exit when Entract;
  432.         end loop;
  433.      end loop;
  434.      Pm_Error := Pm_Terminate;
  435.   end Compositor;
  436.  
  437.  
  438.  
  439.  
  440.   task body Harmonie is
  441.      Date   : String(1..80) := (others => ' ');
  442.      Banner : String(1..80) := (others => ' ');
  443.      Help   : String(1..80) := (others => ' ');
  444.  
  445.      End_Of_Task : Boolean := False;
  446.      Line : String(1..256) :=  (others => ' ');
  447.      Last : Natural := 0;
  448.  
  449.  
  450.      type T_Command is (Null_Item, Start, Stop);
  451.  
  452.      function Value(Command : String) return T_Command is
  453.         Result : T_Command := Null_Item;
  454.      begin
  455.         if Ada.Strings.Fixed.Index(Command , " ",  Ada.Strings.Fixed.Index_Non_Blank(command)) /= 0 then
  456.            return T_Command'Value(Command(Ada.Strings.Fixed.Index_Non_Blank(Command)..Ada.Strings.Fixed.Index(Command, " ", Ada.Strings.Fixed.Index_Non_Blank(Command)) - 1));
  457.         else
  458.            return T_Command'Value(Command(Index_Non_Blank(Command)..Command'last));
  459.         end if;
  460.      exception
  461.            when Constraint_Error =>
  462.            Return Result;
  463.      end Value;
  464.  
  465.      command : T_Command;
  466.  
  467.      Run : Boolean := True;
  468.  
  469.   begin
  470.      accept Start do
  471.         Compositor.Initialize;
  472.         Compositor.Start;
  473.      end Start;
  474.  
  475.      Move("Commands :STOP, START; 'Esc' to quit.", Help, Error, Center);
  476.      Move("""Welcome to Harmonie.""", Banner, Error, Center);
  477.  
  478.      while not End_Of_Task loop
  479.         Move((80 * ' '), Date, Error, Center);
  480.         Move(Full_Datify_String(Clock), Date, Error, Center);
  481.         select
  482.            accept Receive(Char : in Character) do
  483.               Put(Clear_Screen);
  484.               Put_line(Banner);
  485.               Put_Line(Date);
  486.               Put_line(help);
  487.               if Is_Control(Char) then
  488.                  case Char is
  489.                     when Character'Val(10) =>
  490.                        Command := Value(Line(1..Last));
  491.                        Last := 0;
  492.                        case Command is
  493.                           when Stop =>
  494.                              if Run then
  495.                                 Compositor.Stop;
  496.                                 Run := False;
  497.                              end if;
  498.                           when Start =>
  499.                              if not Run then
  500.                                 Compositor.Start;
  501.                                 Run := True;
  502.                              end if;
  503.                           when others =>
  504.                              null;
  505.                        end case;
  506.                     when Character'Val(127) =>
  507.                        if Last /= 0 then
  508.                           Line(Last) := ' ';
  509.                           Last := Last - 1;
  510.                        end if;
  511.                     when others =>
  512.                        null;
  513.                  end case;
  514.               elsif Is_Special(Char) then
  515.                  null;
  516.               else
  517.                  if Last < Line'Length then
  518.                     Line(Last+1) := Char;
  519.                     Last := Last + 1;
  520.                  end if;
  521.               end if;
  522.  
  523.               if Last /= 0 then
  524.                  Put(Position((30 - Last/80),1));
  525.                  put(Line(1..Last));
  526.               end if;
  527.            end Receive;
  528.         or
  529.            accept Halt do
  530.               if not Run then
  531.                  Compositor.Start;
  532.               end if;
  533.               Compositor.Halt;
  534.               End_Of_Task := True;
  535.            end Halt;
  536.           or
  537.              delay 0.05;
  538.              Put(Clear_Screen);
  539.              Put_line(Banner);
  540.              Put_Line(Date);
  541.              Put_line(help);
  542.              if Last /= 0 then
  543.                 Put(Position((30 - Last/80),1));
  544.                 put(Line(1..Last));
  545.              end if;
  546.         end select;
  547.      end loop;
  548.   end Harmonie;
  549.  
  550.   Char : Character;
  551.  
  552.   begin
  553.  
  554.      Harmonie.Start;
  555.      loop
  556.         Get_Immediate(Char);
  557.         case Char is
  558.            when Character'Val(27) =>
  559.  
  560.               Harmonie.Halt;
  561.               exit;
  562.  
  563.            when others =>
  564.               Harmonie.Receive(Char);
  565.         end case;
  566.      end loop;
  567.  
  568.      New_Line;
  569.   end Run;
  570.  
  571. end Midi_Engine;

n°19526637
Profil sup​primé
Posté le 17-08-2009 à 01:00:04  answer
 

Bonsoir la France d'en bas, celle qui va chez lidl et aldi et qui vote PS.

n°19526641
-the_unfor​given-
frakkinn home : 1123.6536.5321
Posté le 17-08-2009 à 01:00:26  profilanswer
 

[:cerveau hurle]  COUCOUUUUUUUUUUUUUUUUUU §§§§§§§§§§§§  [:nicarao]  
 
 
 :sol:  Cay m'waaa !!  :sol:


---------------
FACEBOUKE , bordel a photos :o
n°19526642
XprtZ
Profil : O.O
Posté le 17-08-2009 à 01:00:31  profilanswer
 

Bonsoir  [:javinian]


---------------
PSN : XprtZ - BattleTag : XprtZ#2257 - 3DS : 2492-4109-3060
n°19526646
mika94400
米卡尔™
Posté le 17-08-2009 à 01:00:46  profilanswer
 

salut tout le monde :hello:


---------------
En théorie il n'y a aucune différence entre la théorie et la pratique, dans la pratique ce n'est pas le cas...
n°19526657
totoz
( ͡° ͜ʖ ͡°) KK ( ͡⊙ ͜ʖ ͡⊙)
Posté le 17-08-2009 à 01:01:51  profilanswer
 


le mec qui achete aldi,, qui vote fn et qui boit du boulaouane il se classe ou ? :o


---------------
InstaKAKAgram▲La bouffe de Totoz▲Steam▲BattleTag: Totoz#1835
n°19526659
amdvsintel
Posté le 17-08-2009 à 01:02:10  profilanswer
 

totoz a écrit :


le mec qui achete aldi,, qui vote fn et qui boit du boulaouane il se classe ou ? :o


cat : totoz :)

n°19526660
Profil sup​primé
Posté le 17-08-2009 à 01:02:12  answer
 

[#ff4600][/#ff4600]

n°19526666
XprtZ
Profil : O.O
Posté le 17-08-2009 à 01:02:38  profilanswer
 


 
[:klemton]


---------------
PSN : XprtZ - BattleTag : XprtZ#2257 - 3DS : 2492-4109-3060
n°19526668
-the_unfor​given-
frakkinn home : 1123.6536.5321
Posté le 17-08-2009 à 01:03:03  profilanswer
 


 [:corten]


---------------
FACEBOUKE , bordel a photos :o
n°19526669
amdvsintel
Posté le 17-08-2009 à 01:03:21  profilanswer
 


FAIL

n°19526671
totoz
( ͡° ͜ʖ ͡°) KK ( ͡⊙ ͜ʖ ͡⊙)
Posté le 17-08-2009 à 01:03:30  profilanswer
 


 :love:


---------------
InstaKAKAgram▲La bouffe de Totoz▲Steam▲BattleTag: Totoz#1835
mood
Publicité
Posté le   profilanswer
 

 Page :   1  2  3  4  5  ..  21275  21276  21277  ..  35624  35625  35626  35627  35628  35629

Aller à :
Ajouter une réponse
 

Sujets relatifs
[Topic unique] Du snowboardRecherche d un lien/topic
[Topic sérieux] Accident mortel à Lons le Saunier le 6/10/2003Recherche d'un topic célèbre de l'ancien forum...
[ hugh ] - Le topic pour commencer à fumer !!Délai minimum entre un repas et une séance de sport ?
[Topic football féminin]Le topic de Guy Carlier
Question psycho : Un topic existe a ce sujet ? (rechercher failled)[Topic officiel] Nuit blanche sur Paris!! Vos bons plans
Plus de sujets relatifs à : [Topic Insomniaks] Il est entre 1h et 7h du mat' et tu erres? Entre...


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)