GANN/0000777000175000000040000000000010377174156010251 5ustar qtgeoadmGANN/GANN0000755000175000000040000006160310377174156010724 0ustar qtgeoadmELFP4DM4 (# 444444555LT6HHH Ptd2Qtd/lib/ld-linux.so.2GNU v#Ro#p?~ȅw9^6D% 9 libstdc++.so.5__gxx_personality_v0_Jv_RegisterClasses__gmon_start__libm.so.6expflibgcc_s.so.1libc.so.6fscanffprintffseeksrandtimefgetcfcloseexitfopen_IO_stdin_used__libc_start_mainCXXABI_1.2GLIBC_2.0GLIBC_2.1 үkH ii eii ii     $ ( ,0U9"5%%h%h%h%h%h % h(%h0%h8p%h@`%hHP% hP@%$hX0%(h` %,hh%0hp1^PTRhh0QVhJgUS[o@PtЋ]ÐU=@u-<t<ҡ<u@ÉUt!t hx&]U EPEEE;E| EPsU j jOPÐU(EEh`hbEuhgu}uO uE}buEEE E@uEE]멃}uBEE9DEEt%EDDd$$hjEd$$h|nEd$$hTEEEU(E U EPE} U EP] U EPx]EEEt}EȨt+E}fE fEm]mЙ}U5EШ}fE fEm]mЙ}UU ЉUE ?}uU ЉEDŽ h jU ЉE>U ЉEDŽ}EȨt+E}fE fEm]mЙ}U1Eب}fE fEm]mЙ}UU ЉUE ?}uU ЉEDŽ h jU ЉEu'U ЉEDŽ}uÐU}u-} u'‰)‰P$d$]H}u(} ~"E EЋM9R$d$] h j*EEEÐUjj|Euh}uEE;E|E}u |ÐU} hhE jj u h$u E}~E@Ph.u UEPed$$h8udUEPC PhAu4 UEP8d$$hJu UEPd$$hSuE}~E uUEPd$$E@Ph]u EE}~E uUEPd$$E@Phhu- E볍Ebhvu  u*} u"} u hY j|U]ÐU]ÐUh h( h h h6jP hIjhf hvEPhgN}~ h~ j hnu􍅸P{ hI hѪ9 h)EE}UE)@Ph hEPhg huUE)PPUE)@Ph hEPhg h^uUE)PP E h@& h h hEE}EUE)@Ph hӫEPEPhK hEE@t uUE)PPuuUE)PPE> hjP  hIjhf hvEPhgt}~ h~ j hu􍅨P  ho hѪ_ hOEE}UE)@Ph$ hEPhg huUE)PP. UE)@Ph hEPhgD huUE)PP2 E h@L h< h, hEE}EUE)@Ph hӫEPEPhq hEE@t uUE)PP uuUE)PP: E> hD h 4 h`$ hj hf hvEPhg} ~ h٬ j P\ E؃ PG EԋEEEԉE܃hhbEuuhuEEH9E~huu􍅸P Euhuu􍅸P EuhuVju􍅸P ]Ed$$hu"ju􍅸P ]Ed$$huEEEH9E~huu􍅨P Euhuu􍅨P Euhu`ju􍅨P ]Ed$$hu,ju􍅨P ]Ed$$huE upE;E} h H jkhhLiẼ uuuh$u EԋU‹E܉љEEԋU‹E)ЉE}uEEEЃ}uEhu8hQu%uhuE;Eu4EE;E|EPhuEӋE;E~XEE;E|UEЋ9@PhuEE믋E;E}UEE;E|DUEЋ9@Phu"EE벃 u j7U8eЃ} x}  h`R juh`hLsE EPEPEPhu UJ)ĉe̋EH)ĉeȃ hEE;E|.EEd$$E@PhEȃ hy hԭiEEEE}u uEԃ}+uE}*ugEU;U|3EE4uEEEP EÃu EEEPn}id}+u uEԃ}euNu EEEPAE؃ EEEPE؋UE됃} t}+tE܋Eԃ1EEEEPu d$$u܋EEEP3}~u EEEPEEduu0]EE@tzju hhEU;U|'EUd$$E@Ph5Eσ h   h@\EE;E|KUEE@uvjuuuE@PhIeU]ÐU]ÐUS4)ă h hp h` hڮP h@ h 0 h   h2 hN hg h h h  hvEPhgL h}u @X}u~ hf h.VE}~]j!j\ȍEۃ h@ hF  j)} h h.E}~]j!j(\ȍEۃ h@ h_} jJ}u* hwX hH jk h. jQ jGU} x}  h jUE U} ~}  h jUE BÐU} x UE ;B h'~ j}x} h`V jyUE ЍPEU} x UE ;B h' j1}x} h j UE ЍP EU} x UE ;B h' jUE Ѓ8uDEE@u/EE@u hñG jjUE ЍPEÐU} x UE ;B h' j!EEt h jUE Ѓ8u,EEt h jUE ЍPEUE ЍPEe]E%ÐUE@]ÐU} x UE ;B h' jAUE ЃÐU} x UE ;B h' jUE Ѓ ÐU} x UE ;B h' j}uUE ЃE5}uUE ЃE hB jeEUEu EǀUE  u u8u uUMU EDUE @BUE Dd$$Eph&ÐUE@ EEUE]UEEEÐUEEEÐUUE DEEUUE DPEEUVSE@EU@;B|6uEX8‹EEЋMR$d$\PE@뺃[^]ÐUWVSEE@EU@;B|6}u]EPME@DLPنٟE@[^_]ÐUSMUE@قٙ} uYEUـقEt U?B UB E@ d$$hH} uYEUـقEt U?B UB E@ d$$hHw} ] E5PٛEUـقEtEUP UE5B E@ d$$hQ h` j]UWV1S ì)9s׍&'F9r [^_]ÍU$BNt$)ɍqu[$t$]Nu$ÐUSRtЋuX[]US[Rj]rGIOD%iLearned...%.1f% Correct:%.1f% Error:%.1f% Error: Wrong Check Type Specified! 9@I@Y@Error: Wrong Function Type Of Range Specified! Point to:%i aGKDB%i %i %i Neuron%i Out: %i NFT: %i Sum: %i Base: %i Bit%i: %i Weight%i: %i ******** Error: Wrong Type Specified! # Geeks Neural Map Creator # New I/O GSockets Have To Be Created Please Make Your Choices To Set Up The New GSockets # Input GSocket # Please Specify GPins Number (Min:1,Max:%i) Choice:Error: Too Many GPins! Now Please Specify Type And State Of Every GPin (Types Binary:0,Real:1) (States Off:0,On:1) GPin %i Choice (Type):Choice (State):Now Please Assign Values To The GPins (Values:Binary,Integer,Float) Please Set Min And Max Values (Example:5.5,20.6) Choice (Min,Max):%f,%f# Output GSocket # # Neural Map # Now The GMap Is Ready To Be Created Please Specify How Many GNeurons Your GMap Will Have (Note: GNeurons Must Be Equal Or More Than The Outputs) Error: Too Many GNeurons! w%i %i + %i %f Error: GNeurons Are Less Than The Outputs! GMapR Error: Wrong Simulation Mode Specified! %i %i %i----- Input Socket ----- Input%i:%.3f ----------------------- Start Learning... ----- Final Output ----- Data%i:%f ------------------------ Learning Successfully Completed * Error Correction At Neuron %i * ------------------------- ****** G.A.N.N ****** ========================= Copyright GNU/GPL 2006 George Delaportas Dimitris Vlachos ========================= Please Select An Option 1.Create A New Neural Net 2.Simulate An Existing Neural Net 3.Create A New Neural Net And Simulate It 4.Exit Generating Random Data... Please Stand By! Done Starting Simulation... Starting Simulation... Thank You For Using G.A.N.N Goodbye! Error: Wrong Choice Specified! Error: Wrong Socket Type Specified! Error: Wrong Number Of Pins Specifed! Error: Wrong Pin Specified! Error: Wrong Pin Type Specified! Error: Wrong Pin State Specified! Error: Value Mismatch! Error: Wrong Range Specified! Error: Binary Numbers Have No Range! InSlot->Input%i:%.3f Out->%i Out->%.3f Error: Wrong Neuron Function Type Specified! ;j0LB z(D$`|4Z(~$ @zP|ȅ  x*AB _.(<AB ^...t..hhAB q.mAB S.8h6AB Z.]. j.R. Q..\. x.\. d.$ AB N. . R.(rAB \.A. I.. b.,4JAB DR..X..M.dҟ8AB Y. 9AB Y.DpAB ^.pAB ^.$AB ^.ġAB ^. EAB ^.(EAB ^.D0AB ^.`VAB j.|CAB v.AB Dl.HWe 0 h0 xo@oo^n~΅ޅ.>GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6GCC: (GNU) 3.3.6P", 0 t"$b 6E!^_IO_stdin_usedZPr../sysdeps/i386/elf/start.S/tmp/glibc-2.3.5/csuGNU AS 2.15.92.0.2rttIQ0H"BG#T$0o%qC4()Bj*d+T,int-023>f;v< U00q*h0`0.a?#Hx~aq\0 a0a=jaataLGqYPqe6ahq K 0 4Ea ob0 S Q ]R$IT"N#S#T$y {V#8I#*T#{!h#8"I## &-gt 8<H RR7 X7<?u#v#x#z# {#}#~##$#  #$ #(#,#0#4D#8 =$@5###*# #@#8I##  B  B %K RB@N $RO/ 5AR2XL RR7] a    d  $$ e5 ;G"BjA#k#l*#Dm# n# G  I%#]R#D#= .,42#D3=# M,5 / 4 Q5.78U9TT:0Dd@/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/crti.S/tmp/glibc-2.3.5/csuGNU AS 2.15.92.0.2d(/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/crtn.S/tmp/glibc-2.3.5/csuGNU AS 2.15.92.0.2%% : ; I$ > $ >  : ;  : ; I8 I!I/  I : ;I  : ; : ; I  : ; ( ' II : ; &I'  < !I4: ; I?  %%T/ ../sysdeps/i386/elfstart.SP01:"VWYX  /usr/lib/gcc-lib/i486-slackware-linux/3.3.6/include../sysdeps/generic/bits../wcsmbs../sysdeps/gnu../iconvinit.cstddef.htypes.hwchar.h_G_config.hgconv.hA /tmp/glibc-2.3.5/build-glibc-2.3.5/csucrti.S 2,Wd0",:t ,Wdd,,-:hA /tmp/glibc-2.3.5/build-glibc-2.3.5/csucrtn.S6:E _G_int32_t__time_t__GCONV_INCOMPLETE_INPUT__GCONV_OK__state__gconv_init_fct_G_iconv_t__rlim64_t__GCONV_ILLEGAL_DESCRIPTOR__gconv_infoGNU C 3.3.6short unsigned intunsigned char__useconds_t__counter__fct__val__GCONV_NOCONV__value__nsteps_G_int16_t__max_needed_from__gconv_btowc_fct__off_t__ssize_t__statepinit.c__fsfilcnt_t__steps__fsfilcnt64_t__blkcnt_t__gconv_loaded_object_G_fpos64_t__gconv_t__trans_end_fct__u_int__GCONV_ILLEGAL_INPUT__blksize_t__to_name__uint64_t__id_t__GCONV_EMPTY_INPUT__cd__ino_t__count__invocation_counter__pid_t__u_short/tmp/glibc-2.3.5/csu__quad_t__u_long__fsid_t__GCONV_FULL_OUTPUT__max_needed_to__timer_t__stateful__uint32_t__key_t__u_char__gconv_step__shlib_handle__min_needed_toshort int__dev_tlong long int__gconv_trans_data__outbuflong long unsigned int__uid_t__wchb__uint16_twint_t__u_quad_t__gconv_trans_end_fct__flags__outbufend__combined__gconv_trans_init_fct__init_fct__modname__trans_context_fct__trans_fct__rlim_t__wch__intptr_t__suseconds_t__ino64_twchar_t__GCONV_IS_LAST__blkcnt64_t__fsblkcnt64_t__mode_t__qaddr_t__pos__gconv_end_fct_IO_stdin_used__internal_use__GCONV_NODB__clock_t__gconv_step_data__gconv_trans_query_fct__socklen_t__int64_t__GCONV_NOMEM__off64_t__btowc_fct_G_fpos_t__int8_t__daddr_t__fsblkcnt_t_G_uint32_t__nlink_t__swblk_t__GCONV_INTERNAL_ERROR__mbstate_t__gid_t__clockid_t__int32_t__gconv_trans_context_fct__next__GCONV_IGNORE_ERRORS__end_fct__trans__uint8_t__gconv_fct__from_name__min_needed_from__gconv_trans_fct__data__caddr_t_G_uint16_t__loff_t__int16_t.symtab.strtab.shstrtab.interp.note.ABI-tag.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.rel.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment.debug_aranges.debug_pubnames.debug_info.debug_abbrev.debug_line.debug_str44#HH 1hh7 0?00Go&To@@pc l x u00pHH{PP!  (@@(N 2<<3556666H447 @@7@7~7x88%]8 'B8_C:*0Et L5R "X \4Hh0@ 0 H P  @<4@ !"<GRGG<G<t  (5<9@E [ gt <D<@D" )> 40" I T]R" s@z#C" V" p" " x* 8 P E" 1A0 G T8 _#q?$"  9" ġ" h6 ҟ8" P  " ,f " Ap" Vr at0T ȅ@J m 0i"   4 "94  :LDp" aL+ k^|D " E" @ Hh 60D? T4aФ_" | "  /tmp/glibc-2.3.5/build-glibc-2.3.5/config.habi-note.S/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/abi-tag.hinit.c/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/crti.S/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/defs.hinitfini.ccall_gmon_startcrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST__p.0completed.1__do_global_dtors_auxframe_dummy__CTOR_END____DTOR_END____FRAME_END____JCR_END____do_global_ctors_aux/tmp/glibc-2.3.5/build-glibc-2.3.5/csu/crtn.Sgann.cppBufferAUTOMAX_GNMAX_PIN_ZN7GNeuron6GetSumEvfgetc@@GLIBC_2.0_Z4GNMSPii_ZN7GSocket5GetPVEii_Z6GNMOpti_DYNAMIC_ZN7GNeuron7OutDataEv_fp_hwfprintf@@GLIBC_2.0_ZN7GNeuron6InDataEif_ZN7GNeuron6EnableEi__fini_array_end_ZN7GNeuron7GetBaseEv_ZN7GNeuron5NFuncEi_Z5GStatPfS___dso_handle__libc_csu_fini_ZN7GSocket5GetPSEiexpf@@GLIBC_2.0_init_Z8GRemDatav_Z6GSleepifscanf@@GLIBC_2.0scanf@@GLIBC_2.0_ZN7GSocket5SetPVEif_ZN7GSocket7SetPinsEi_ZN7GSocket5SetPVEiff_Z9GSaveDataP7GNeuronifseek@@GLIBC_2.0time@@GLIBC_2.0_ZN7GSocket5SetSTEi_start_ZN7GSocket7GetPinsEv_ZN7GNeuron6GetNFTEv_ZN7GSocket5SetPSEii_Z4GNMSPfi__fini_array_start__libc_csu_init__gxx_personality_v0@@CXXABI_1.2__bss_startmain__libc_start_main@@GLIBC_2.0_Z9GReadDataP7GNeuroni__init_array_end_ZN7GNeuron3SumEv_Z5GSNMCvdata_startprintf@@GLIBC_2.0_finifclose@@GLIBC_2.1_ZN7GSocket5SetPTEii_Z5GRandvsrand@@GLIBC_2.0_Z6GUMsgSv_ZN7GNeuron10GetWeightsEiexit@@GLIBC_2.0_ZN7GSocket5GetPTEi_edata__i686.get_pc_thunk.bx_GLOBAL_OFFSET_TABLE__end_Z8GGenDataiifopen@@GLIBC_2.1__init_array_start_IO_stdin_used_Z5GErrCP7GNeuronifi__data_start_ZN7GNeuron11RandWeightsEv_Jv_RegisterClasses_ZN7GNeuron9GetInDataEirand@@GLIBC_2.0__gmon_start__GANN/gsnmc.cpp0000644000175000000040000001705610377173771012073 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Socket And Neural Map Creator Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Geeks Socket And Neural Map Creator (Function) void GSNMC() { //Variables int i,j,k; //Counters float v,n,m; //Float Values int GNNum; //Geeks Neurons Number int Inputs,Outputs; //GSockets I/O int Tmp; //Temp Variable FILE *GMap; //The Geeks Neural Map FILE *GIOD; //The Geeks I/O Distribution //Create I/O GSockets GSocket InSocket; GSocket OutSocket; //Get User Values To Create The I/O GSockets printf("# Geeks Neural Map Creator #\n"); printf("New I/O GSockets Have To Be Created\n"); printf("Please Make Your Choices To Set Up The New GSockets\n\n"); printf("# Input GSocket #\n"); InSocket.SetST(0); printf("Please Specify GPins Number\n"); printf("(Min:1,Max:%i)\n",MAX_PIN); printf("Choice:"); scanf("%i",&i); //Check Inputs if (i>MAX_PIN) { printf("Error: Too Many GPins!\n"); exit(1); } printf("\n"); InSocket.SetPins(i); printf("Now Please Specify Type And State Of Every GPin\n"); printf("(Types Binary:0,Real:1)\n"); printf("(States Off:0,On:1)\n"); for (j=i;j>=1;j--) { printf("GPin %i\n",i-j+1); printf("Choice (Type):"); scanf("%i",&k); printf("\n"); InSocket.SetPT(i-j,k); printf("GPin %i\n",i-j+1); printf("Choice (State):"); scanf("%i",&k); printf("\n"); InSocket.SetPS(i-j,k); } printf("Now Please Assign Values To The GPins\n"); printf("(Values:Binary,Integer,Float)\n"); printf("Please Set Min And Max Values\n"); printf("(Example:5.5,20.6)\n"); for (j=i;j>=1;j--) { m=0.0; printf("GPin %i\n",i-j+1); printf("Choice (Min,Max):"); scanf("%f,%f",&n,&m); printf("\n"); if (m==0.0) InSocket.SetPV(i-j,n); else InSocket.SetPV(i-j,n,m); } printf("# Output GSocket #\n"); OutSocket.SetST(1); printf("Please Specify GPins Number\n"); printf("(Min:1,Max:%i)\n",MAX_PIN); printf("Choice:"); scanf("%i",&i); //Check Outputs if (i>MAX_PIN) { printf("Error: Too Many GPins!\n"); exit(1); } printf("\n"); OutSocket.SetPins(i); printf("Now Please Specify Type And State Of Every GPin\n"); printf("(Types Binary:0,Real:1)\n"); printf("(States Off:0,On:1)\n"); for (j=i;j>=1;j--) { printf("GPin %i\n",i-j+1); printf("Choice (Type):"); scanf("%i",&k); printf("\n"); OutSocket.SetPT(i-j,k); printf("GPin %i\n",i-j+1); printf("Choice (State):"); scanf("%i",&k); printf("\n"); OutSocket.SetPS(i-j,k); } printf("Now Please Assign Values To The GPins\n"); printf("(Values:Binary,Integer,Float)\n"); printf("Please Set Min And Max Values\n"); printf("(Example:5.5,20.6)\n"); for (j=i;j>=1;j--) { m=0.0; printf("GPin %i\n",i-j+1); printf("Choice (Min,Max):"); scanf("%f,%f",&n,&m); printf("\n"); if (m==0.0) OutSocket.SetPV(i-j,n); else OutSocket.SetPV(i-j,n,m); } //Get User Values To Create The Neural Map printf("# Neural Map #\n"); printf("Now The GMap Is Ready To Be Created\n"); printf("Please Specify How Many GNeurons Your GMap Will Have\n"); printf("(Note: GNeurons Must Be Equal Or More Than The Outputs)\n"); printf("(Min:1,Max:%i)\n",MAX_GN); printf("Choice:"); scanf("%i",&GNNum); //Check GNNum if (GNNum>MAX_GN) { printf("Error: Too Many GNeurons!\n"); exit(1); } //Get GSockets I/O Inputs=InSocket.GetPins(); Outputs=OutSocket.GetPins(); //Final GNNum GNNum=GNNum+Inputs+Outputs; //Initialize GIOD GIOD=fopen("GIOD","w"); //Set Starting Header fprintf(GIOD,"%i\n%i\n",Inputs,Outputs); //Save I/O GSockets Distribution for (i=0;i<=Inputs-1;i++) { fprintf(GIOD,"+\n"); j=InSocket.GetPT(i); fprintf(GIOD,"%i\n",j); j=InSocket.GetPS(i); fprintf(GIOD,"%i\n",j); v=InSocket.GetPV(i,0); fprintf(GIOD,"%f\n",v); v=InSocket.GetPV(i,1); fprintf(GIOD,"%f\n",v); } for (i=0;i<=Outputs-1;i++) { fprintf(GIOD,"+\n"); j=OutSocket.GetPT(i); fprintf(GIOD,"%i\n",j); j=OutSocket.GetPS(i); fprintf(GIOD,"%i\n",j); v=OutSocket.GetPV(i,0); fprintf(GIOD,"%f\n",v); v=OutSocket.GetPV(i,1); fprintf(GIOD,"%f\n",v); } //Close GIOD fclose(GIOD); //Check For Problematic GMap if (GNNumOutputs) { for (i=0;iNFBase) { //Statistically Weighted Neurons if (CheckType==0) { //Random e if (Err<=25.0) e=rand()%(int)Err; else e=rand()%(int)(50.0-Err+1); //Make Summary Smaller Than NFunc Base (Output:0) GANN[GNNum].Mod=e; } //Statically Weighted Neurons else if (CheckType==1) { //Make Summary Smaller Than NFunc Base (Output:0) GANN[GNNum].Mod=1; } else { printf("Error: Wrong Check Type Specified!\n"); exit(1); } //Zero Mod Check if (GANN[GNNum].Mod==0) GANN[GNNum].Mod=8; } else { //Statistically Weighted Neurons if (CheckType==0) { //Random e if (Err>=25.0) e=rand()%(int)Err; else e=rand()%(int)(100.0-Err); //Make Summary Bigger Than NFunc Base (Output:1) GANN[GNNum].Mod=e; } //Statically Weighted Neurons else if (CheckType==1) { //Make Summary Bigger Than NFunc Base (Output:1) GANN[GNNum].Mod=128; } else { printf("Error: Wrong Check Type Specified!\n"); exit(1); } //Zero Mod Check if (GANN[GNNum].Mod==0) GANN[GNNum].Mod=8; } } else if (NFuncType==1) { } else if (NFuncType==2) { } } /* ------------------------------------------------------------------------ */ GANN/ggendata.cpp0000666000175000000040000000302610375663547012535 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Generate Random Data Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Geeks Generate Data (Function) float GGenData(int FuncType,int Range) { float RandomData; //Randomize GRand(); //Check Function Type (0:Binary,1:Real) if (FuncType==0 && Range==0) { //Produce Random Binary Data RandomData=rand()%2; } else if (FuncType==1 && Range>0) { //Produce Random Real Data RandomData=rand()%Range; } else { printf("Error: Wrong Function Type Of Range Specified!\n"); exit(1); } //Give Results return RandomData; } /* ------------------------------------------------------------------------ */ GANN/About.txt0000666000175000000040000000561210376454651012070 0ustar qtgeoadm------------------------------------------------------------------------------ ***** Geeks Artificial Neural Network (G.A.N.N) ***** ------------------------------------------------------------------------------ ============================================================================== Conformed To GNU/GPL Licence ============================================================================== Developed by George Delaportas (Lead Programmer) and Dimitris Vlachos (Assistant Programmer) Copyright GNU/GPL 2006 ------------------------------------------------------------------------------ *** About G.A.N.N *** ------------------------------------------------------------------------------ G.A.N.N is a project that started with the "Black Box" philosophy in mind. G.A.N.N wants to achieve the creation of a centralized and unified core that is based on an Advanced Neural Network design and performs all the needed functions and procedures automatically. In other words, G.A.N.N will give to the developer or the end user the ability to build and run projects without the need of extreme programming skills or even worse, the need of endless code. G.A.N.N just like the "Black Box" has Inputs and Outputs. G.A.N.N only needs to know the Inputs or the Outputs or the Inputs and the expected Outputs. The choices are based on the project needs. G.A.N.N does that by "Learning By Example" method. Test it and feel free to tell us your comments and suggestions at: g.delaportas@gmail.com Enjoy! ------------------------------------------------------------------------------ *** G.A.N.N Files *** ------------------------------------------------------------------------------ 01.gann.cpp: G.A.N.N Main File 02.gneuron.cpp: G.A.N.N Neuron (Module) 03.gsocket.cpp: G.A.N.N Socket (Module) 04.gnms.cpp: G.A.N.N Simulator (Function) 05.gsnmc.cpp: G.A.N.N Socket And Map Creator (Function) 06.gnmopt.cpp; G.A.N.N Neural Map Optimizer (Function) 07.gerrc.cpp: G.A.N.N Error Corection (Function) 08.gstat.cpp: G.A.N.N Statistics (Function) 09.ggendata.cpp: G.A.N.N Generate Data (Function) 10.greaddata.cpp: G.A.N.N Read Data From GKDB (Function) 11.gsavedata.cpp: G.A.N.N Save Data To GKDB (Function) 12.gremdata.cpp: G.A.N.N Remove Data From GKDB (Function) 13.grand.cpp: G.A.N.N Random Numbers Generation (Function) 14.gsleep.cpp: G.A.N.N Delay - Sleep (Function) 15.gumsgs.cpp: G.A.N.N Unified Messaging System (Function) 16.gglobal.cpp: G.A.N.N Global Constants 17.GKDB: G.A.N.N Knowledge Data Base (Auto Generated) 18.GMap: G.A.N.N Map (Auto Generated) 19.GIOD: G.A.N.N I/O Distribution (Auto Generated) 20.GANN: G.A.N.N Binary File 21.About.txt: G.A.N.N This File 22.COPYING: G.A.N.N GNU/GPL ------------------------------------------------------------------------------ GANN/gsleep.cpp0000666000175000000040000000217510375663720012237 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Sleep Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Geeks Sleep (Function) void GSleep(int Sec) { //Variables time_t Go; //Time Variable time(&Go); Sec+=Go; while (Go2) { printf("Error: Wrong Simulation Mode Specified!\n"); exit(1); } //Read GMap GMap=fopen("GMap","r"); //Get Header fscanf(GMap,"%i\n%i\n%i",&GNNum,&Inputs,&Outputs); //Create A New GANN GNeuron GANN[GNNum]; //GANN Matrix //Final Data float FinalData[Outputs]; //Last Outputs //Print Input Socket printf("----- Input Socket -----\n"); for (i=0;i-1) GANN[i].Enable(SMode); //Reset k k=-1; //Increase i (Next Neuron) i++; } } //Gather Error Statistics ErrStat=GStat(Data,FinalData); //Check Error Statistics if (ErrStat==0.0) { //Save This G.A.N.N Map To The GKDB GSaveData(GANN,AUTO); printf("----- Final Output -----\n"); for (j=0;jBase) Out=1; else Out=0; printf("Out->%i\n",Out); } else if (FType==1) { //Sign Function if (Summary>Base) Out=1; else Out=-1; printf("Out->%i\n",Out); } else if (FType==2) { //Sigmoid Function (Real Systems Sequence) SigFunc=1/(1+expf(-1*Summary)); if (Summary>Base) Out=SigFunc; else Out=-SigFunc; printf("Out->%.3f\n",Out); } else { printf("Error: Wrong Neuron Function Type Specified!\n"); exit(1); } } public: //Public Variables int Mod; //Modulo //Enable Neuron void Enable(int NFType) { //If This Is A New Neuron,Check And Fix Modulo if (Mod==0) Mod=8; //Set Neuron Function Type Globally NFT=NFType; //Run Functions RandWeights(); Sum(); NFunc(NFType); } //Set Input Data void InData(int Inputs,float Data) { InSlot[Inputs]=Data; In=Inputs+1; printf("InSlot->Input%i:%.3f\n",In,InSlot[Inputs]); } //Give Output Data float OutData() { return Out; } //Get Neuron Function Type int GetNFT() { //Return The Function Type return NFT; } //Get Base float GetBase() { //Return The NFunc Base return Base; } //Get Sum float GetSum() { //Return The Neuron Summary return Summary; } //Get Input Data float GetInData(int DIndex) { return InSlot[DIndex]; } //Get Weights float GetWeights(int WIndex) { return Weights[WIndex]; } }; /* ------------------------------------------------------------------------ */ GANN/gsocket.cpp0000666000175000000040000001347610377154657012433 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - An I/O Socket Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Geeks Socket (Class - Model) class GSocket { private: //Private Variables int SockType; //Socket Type int SockPins; //Socket Pins //Structure Of A Geeks Pin struct GPin { int Type; int State; float Value; float Range; }; //Load Pins Matrix GPin Pins[MAX_PIN]; //New Pins public: //Set Socket Type (I/O) void SetST(int SType) { //Check Socket Type (0:Input,1:Output) if (SType<0 || SType>1) { printf("Error: Wrong Socket Type Specified!\n"); exit(1); } SockType=SType; } //Set Pins Number void SetPins(int Num) { //Check Socket Pins (Not Less Than 1 Or Not More Than MAX_PIN) if (Num<1 || Num>MAX_PIN) { printf("Error: Wrong Number Of Pins Specifed!\n"); exit(1); } SockPins=Num; } //Set Pin Type void SetPT(int Pin,int PinType) { //Check Socket Pins if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } //Socket Pin Type (0:Binary,1:Real) if (PinType<0 || PinType>1) { printf("Error: Wrong Pin Type Specified!\n"); exit(1); } Pins[Pin].Type=PinType; } //Set Pin State void SetPS(int Pin,int PinState) { //Check Socket Pins if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } //Socket Pin State (0:Off,1:On) if (PinState<0 || PinState>1) { printf("Error: Wrong Pin State Specified!\n"); exit(1); } Pins[Pin].State=PinState; } //Set Pin Value void SetPV(int Pin,float Val) { //Check Socket Pins And Values if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } if (Pins[Pin].Type==0 && Val!=0.0 && Val!=1.0) { printf("Error: Value Mismatch!\n"); exit(1); } Pins[Pin].Value=Val; } //Set Pin Value With Range [Overloaded] void SetPV(int Pin,float Val1,float Val2) { //Check Socket Pins And Values if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } if (Val2<=Val1) { printf("Error: Wrong Range Specified!\n"); exit(1); } if (Pins[Pin].Type==0 && Val2>0.0) { printf("Error: Binary Numbers Have No Range!\n"); exit(1); } Pins[Pin].Value=Val1; Pins[Pin].Range=fabsf(Val2-Val1); } //Get Socket Type (I/O) int GetST() { return SockType; } //Get Pins Number int GetPins() { return SockPins; } //Get Pin Type int GetPT(int Pin) { if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } return Pins[Pin].Type; } //Get Pin State int GetPS(int Pin) { if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } return Pins[Pin].State; } //Get Pin Value Or Pin Value With Range float GetPV(int Pin,int Choice) { if (Pin<0 || Pin>SockPins) { printf("Error: Wrong Pin Specified!\n"); exit(1); } if (Choice==0) return Pins[Pin].Value; else if (Choice==1) return Pins[Pin].Range; else { printf("Error: Wrong Choice Specified!\n"); exit(1); } } }; /* ------------------------------------------------------------------------ */ GANN/gglobal.cpp0000666000175000000040000000210010375663561012356 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Global Constants Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ const int AUTO=0; //Automatic Definition (Default:0) const int MAX_GN=32; //Maximum GNeurons (Default:32) const int MAX_PIN=16; //Maximum Pins (Default:16) /* ------------------------------------------------------------------------ */ GANN/gstat.cpp0000666000175000000040000000470710375663764012115 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Error Statistics Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Xtra Static Variable static float Buffer; //A Buffer //Geeks Statistics (Function) float GStat(float FirstData[],float LastData[]) { //Variables register int i,j; //Counters register int C; //Distribution Values From GIOD int S; //Outputs Number int Y; //A Tracer float q; //A Float Counter float OK,Error; //OK And Error Values (%) FILE *GIOD; //I/O Distribution //Reset Counter q=0.0; //Reset Tracer Y=0; //Read GTOD GIOD=fopen("GIOD","r"); //Read I/O fscanf(GIOD,"%i",S); //Find Differences Between I/O Distribution And User/G.A.N.N I/O while (C!=EOF) { C=fgetc(GIOD); if (C=='+') i++; if (C=='b') { for (j=0;j=1;j++) ; } if (C!=LastData[S]) { //Enable Tracer Y=1; //Increase q q++; } } //Statistics (%) if (Y==0) { OK=100; Error=0; } else { //OK=((0-q)/0)*100; //Error=(q/0)*100; //Print Buffer if (Buffer #include #include #include #include #include "gglobal.cpp" #include "gsleep.cpp" #include "grand.cpp" #include "gsocket.cpp" #include "gneuron.cpp" #include "gstat.cpp" #include "gerrc.cpp" #include "ggendata.cpp" #include "greaddata.cpp" #include "gsavedata.cpp" #include "gremdata.cpp" #include "gnmopt.cpp" #include "gsnmc.cpp" #include "gnms.cpp" #include "gumsgs.cpp" //Main Function int main(int argc,char **argv) { //Variables int i; //A Counter float Data[5]; //Real Data printf("-------------------------\n"); printf("****** G.A.N.N ******\n"); printf("-------------------------\n"); printf("=========================\n"); printf("Copyright GNU/GPL 2006\n"); printf("George Delaportas\n"); printf("Dimitris Vlachos\n"); printf("=========================\n\n"); printf("Please Select An Option\n"); printf("1.Create A New Neural Net\n"); printf("2.Simulate An Existing Neural Net\n"); printf("3.Create A New Neural Net And Simulate It\n"); printf("4.Exit\n"); printf("Choice:"); scanf("%i",&i); printf("\n"); //Check Choices if (i==1) { //Create GSockets And GMap GSNMC(); } else if (i==2) { printf("Generating Random Data...\n"); printf("Please Stand By!\n"); //Get Random Generated Data for (i=0;i<5;i++) Data[i]=GGenData(1,33); printf("Done\n"); printf("Starting Simulation...\n\n"); //Halt (Very Usefull For Better Randomization - Use After GGenData) GSleep(1); //Simulate The G.A.A.N At Learning Mode (Hybrid Simulation Mode) //GNMS(Data,2); //Simulate The G.A.N.N At Running Mode //GNMS(Data,2); } else if (i==3) { //Create GSockets And GMap GSNMC(); printf("Generating Random Data...\n"); printf("Please Stand By!\n"); //Get Random Generated Data for (i=0;i<5;i++) Data[i]=GGenData(1,33); printf("Done\n"); printf("Starting Simulation...\n"); GSleep(1); //Learning Mode //GNMS(Data,2); //Running Mode //GNMS(); } else if (i==4) { printf("Thank You For Using G.A.N.N\n"); printf("Goodbye!\n"); exit(0); } else { printf("Error: Wrong Choice Specified!\n"); exit(1); } exit(0); } /* ------------------------------------------------------------------------ */ GANN/greaddata.cpp0000666000175000000040000000552210375663650012675 0ustar qtgeoadm/* Geeks Artificial Neural Network (G.A.N.N) - Read Data Copyright GNU/GPL 2006 George Delaportas (qtgeo) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Geeks Read Data (Function) int GReadData(GNeuron OpenGANN[MAX_GN],int GNum) { //Variables int i,j; int GANNType,GNeurons,GNInputs; int GNOut,GNFT,GNSum,GNBase; int GNBits[8],GNWeights[8]; int *GKDB; int Pointer; //Create A File Pointer FILE *FileToOpen; //Read GKDB Pointer=fseek(FileToOpen,0,SEEK_SET); //FileToOpen=fopen("GKDB","r"); printf("Point to:%i\n",Pointer); //Check End Of File //while (EOF==0) //{ //Read Starting Header //fscanf(FileToOpen,"%i\n%i\n%i\n",&GANNType,&GNeurons,&GNInputs); //Fill With Data //*(NKDB+0)=GANNType; //*(NKDB+1)=GNeurons; //*(NKDB+2)=GNInputs; //Check G.A.N.N Type (0:Binary,1:Sign,2:Sigmoid) if (GANNType==0) { for (i=0;i Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.