Exemple #1
0
            public cNetFF(String fn)
            {
                StreamReader file = new StreamReader(fn);


                int ii = 0;

                LayerCount = ExtractIntFromString(file.ReadLine());          //LayerCount : 2
                Nl         = ExtractIntArrayFromString(file.ReadLine());     //Neurons : 256 71 40

                Input  = new double[Nl[0]];
                Output = new double[Nl[Nl.Length - 1]];
                Layer  = new cLayer[Nl.Length];

                for (int i = 0; i < Nl.Length; i++)
                {
                    Layer[i] = new cLayer(Nl[i]);
                }

                for (int l = 1; l < Layer.Length; l++)
                {
                    for (int j = 0; j < Layer[l].Neuron.Length; j++)
                    {
                        Layer[l].Neuron[j].setWeight(Nl[l - 1]);
                    }
                }
                InputStat        = new TDataStatistics();
                IsStatCalculated = false;
                ii = ExtractIntFromString(file.ReadLine());                           //need to check??? //SigmoidType : 1
                DesiredOutputValue   = ExtractIntFromString(file.ReadLine());         //DesiredOut : 1
                FeatureExtType       = ExtractStrFromString(file.ReadLine());         //FeatureExtType : PDC4818
                InputStat.DataMean   = ExtractDoubleArrayFromString(file.ReadLine()); //InputMean : 6.38817406390053 13.7360368175028 1.27620355645511 6.09553756445472 1.04051611970507 3.35799479543155 1.53351645703821 3.82051467399161 4.98903667293142 9.38843911136813 2.29091369090646 7.42860585032047 1.23908486338008 3.68848489229435 3.32974314490868 2.37086164522192 4.56535829598574 8.73581996048383 3.29772059177871 8.24207267119657 1.26917979856392 4.11992193147318 5.06775577080623 1.84012818659342 5.49490386005494 8.51732446629078 4.07728543202737 7.84942894318346 1.43254541949786 4.02008336947617 5.66906414148716 1.78189002939617 5.87846368849694 8.36092236518722 4.50601175846947 6.85389860729603 1.52426389089682 3.87105440701653 5.76340899233772 1.81406920148427 4.97954315454677 7.9735313960773 5.02215555876825 5.78407064719773 1.34773022986844 4.17584694713508 5.78380559973013 1.74831333429714 5.1029588935473 6.69756879186545 5.58836923521758 3.90401667389523 1.3485976579442 3.82759866994362 5.65607681557515 1.62383740542624 6.93962941544986 7.03723916919667 6.2814563153583 1.66007662281336 2.20308659823623 1.91858223700063 5.05840682376753 1.14543877403499 7.90314924581948 6.54772059177871 1.45939954700978 5.2348802467351 1.69326779432317 2.42356994843622 1.1162112669269 4.51227651679437 7.52790226977013 4.86845212278926 3.4380752734808 4.60447689267987 3.54278107079177 1.28650426485471 1.7976242108814 5.27370970073731 9.89024625319262 4.47492891908824 5.31010553708255 4.25903570912245 3.8228157679148 1.27592646137536 2.18311165726953 5.72427834803142 10.7913594525565 5.57370729121488 6.01937256035854 4.20809840489615 3.45002650474676 1.61033203219122 2.1603898607296 5.48168762951183 10.4839525805985 5.92243747289287 6.31769553274541 4.18974989157149 3.6499927714327 1.68053346826659 1.91999180762373 5.26858946556792 10.6185846465231 4.98513324659053 7.13848730181678 3.62087369283408 4.02828779335936 1.44412317478676 1.81849067514819 5.14778805840682 10.9397017011228 5.32171943520794 7.42283504409426 2.65106500891523 3.92199171124283 1.33193581032239 2.10824779528697 3.70282155076864 13.9919642426871 7.05864777601079 6.97406149101248 1.42901546913402 3.69546045973688 1.08059852537227 3.34004385330827 1.7284829646764 6.61688593320804 1.56238253578141 6.71347163992097 7.78098645848393 1.813828249241 2.39842658185148 4.39163172859139 1.04602187846369 6.60632017734085 3.33052623969929 6.83850175895138 6.26022842272662 3.76603537178931 1.52802274589176 3.363488506578 1.75792732880343 6.05588887282541 4.83930894896632 4.55996096573659 6.58455014216182 4.00209628451641 1.45123126596309 3.71556792443738 1.86819912293383 4.92605175654185 6.32226157775529 4.7522649510867 6.25303599826514 3.34097151944485 1.42887089778806 4.05186497036287 1.70005059997109 3.97774806033444 7.65760686231989 4.72416991952195 6.79935906703291 3.28531155125054 1.36554864825792 4.17924437376512 1.84603151655342 3.24184376656547 8.2268444894222 4.66864247506144 8.46383306828587 3.25434918799094 1.28084188713797 4.01787865645029 2.2302539636644 2.4841573900053 7.80745506240663 5.55282877933594 11.2763842706376 3.22614572791673 1.21438725844538 3.19403884150161 2.7663004192569 1.42559394727965 7.20984530865982 5.0877066165486 15.7092911185003 3.5319141246205 1.02274589176425 1.66001638475254 3.70101440894415 6.15229386535589 1.35310346489326 16.0635993446099 6.37828297431449 1.0290949833743 3.79439545082165 4.40808876680642 1.54919040046263 6.24098838610187 2.34995903811864 11.0076863765602 7.06294877355308 1.3416100428895 3.28022745891764 3.00501180665992 2.92029299792781 6.78328755240711 2.99306057539396 8.49127752879379 4.99221724254253 1.45109874222929 3.15830562382536 2.25852970941159 4.04279311840393 6.74484362199412 3.63342730470821 7.40902848055515 4.66394390631777 1.50269866512457 3.07691195605031 1.89531829791335 4.64919762902993 5.99041010071804 4.42208809214014 6.98548262734326 4.45077345670088 1.36972916967857 3.23821743530432 2.02225193966556 4.43566575104814 4.6799069924341 5.31922557949015 6.58644161727146 4.4704472073635 1.2830947906125 3.6327405908149 2.02639631824972 3.86457279167269 3.27922750710809 6.10448894029203 6.93614765553467 5.39320996578478 1.44370150836104 3.39853501036095 1.64794467736495 3.67743723194063 1.59087513854754 6.67603970892969 9.2962146402583 5.08095995373717 2.19590622138692 1.77869741217291 1.07459881451496 4.4042576261385
                InputStat.DataMaxDev = ExtractDoubleArrayFromString(file.ReadLine()); //InputMaxDev : 22.6118259360995 18.2639631824972 1.27620355645511 24.4044624355453 1.45948388029493 27.1420052045685 1.53351645703821 25.6794853260084 26.2609633270686 21.1115608886319 4.20908630909354 19.0713941496795 5.26091513661992 22.8115151077057 3.32974314490868 23.1291383547781 27.4346417040143 21.2641800395162 7.20227940822129 14.2579273288034 9.23082020143607 18.3800780685268 5.43224422919377 20.6598718134066 26.5050961399451 21.4826755337092 10.4227145679726 10.6505710568165 13.0674545805021 14.4799166305238 8.83093585851284 16.7181099706038 26.1215363115031 21.8890776348128 13.9939882415305 7.64610139270397 15.9757361091032 10.6289455929835 12.7365910076623 12.6859307985157 27.0204568454532 22.7764686039227 17.4778444412317 5.78407064719773 18.1522697701316 6.32415305286492 16.7161944002699 8.75168666570286 23.6470411064527 24.3024312081345 20.9116307647824 3.90401667389523 12.4014023420558 3.82759866994362 20.8439231844248 4.87616259457376 23.5603705845501 24.9627608308033 24.2185436846417 1.66007662281336 22.2969134017638 1.91858223700063 25.4415931762325 1.35456122596501 22.8468507541805 22.4522794082213 1.45939954700978 25.2651197532649 1.69326779432317 18.3264300515638 1.3837887330731 25.9877234832056 22.7220977302299 26.3815478772107 3.4380752734808 21.8955231073201 3.54278107079177 17.4634957351453 4.7023757891186 21.2262902992627 21.3597537468074 27.5250710809118 5.31010553708255 18.2409642908775 6.6771842320852 18.2240735386246 8.31688834273047 16.7757216519686 20.2086405474435 26.4262927087851 8.48062743964146 14.2919015951039 11.0499734952532 16.3896679678088 12.3396101392704 13.0183123704882 21.2660474194015 26.0775625271071 12.1823044672546 10.3102501084285 14.8500072285673 12.8194665317334 16.5800081923763 9.23141053443208 20.3814153534769 27.0148667534095 15.3615126981832 6.87912630716592 18.4717122066406 9.05587682521324 20.6815093248518 5.35221194159318 19.5602982988772 23.4282805647921 19.0771649559057 3.84893499108477 22.5780082887572 5.16806418967761 22.891752204713 3.70282155076864 17.0080357573129 23.4413522239892 23.5259385089875 1.42901546913402 26.8045395402631 1.41940147462773 25.1599561466917 1.7284829646764 23.883114066792 1.56238253578141 23.536528360079 23.9690135415161 1.813828249241 26.8515734181485 26.1083682714086 1.45397812153631 19.8936798226591 3.33052623969929 25.1614982410486 24.2397715772734 3.76603537178931 21.9719772541082 23.136511493422 4.74207267119657 16.4441111271746 5.66069105103368 27.4400390342634 24.4154498578382 6.49790371548359 20.0487687340369 18.7844320755626 8.63180087706617 13.5739482434581 8.17773842224471 27.2477350489133 24.4969640017349 11.1590284805552 15.0711291022119 14.4481350296371 12.7999494000289 10.5222519396656 10.8423931376801 27.025830080478 24.2006409329671 15.2146884487495 13.1344513517421 10.3207556262349 16.6539684834466 7.25815623343453 14.2731555105778 26.3313575249386 23.0361669317141 19.2456508120091 9.21915811286203 6.48212134354971 20.2697460363356 4.0158426099947 18.6925449375934 26.1971712206641 20.7236157293624 23.2738542720833 5.28561274155462 3.30596115849839 23.7336995807431 1.42559394727965 23.2901546913402 25.9122933834514 16.2907088814997 26.4680858753795 1.47725410823575 1.66001638475254 26.0489855910559 24.3477061346441 1.35310346489326 16.0635993446099 21.3717170256855 1.4709050166257 26.7056045491784 25.0919112331936 1.54919040046263 20.2590116138981 4.15004096188136 20.9923136234398 24.9370512264469 5.1583899571105 23.2197725410824 23.4949881933401 3.57970700207219 15.7167124475929 7.50693942460604 23.5087224712062 27.0077827574575 9.04890125777071 19.3416943761746 20.2414702905884 6.45720688159607 11.7551563780059 10.8665726952918 24.5909715194448 27.3360560936822 12.9973013348754 15.4230880439497 16.6046817020866 9.85080237097007 8.50958989928196 14.0779119078599 25.0145173726567 27.2992265432991 17.1302708303214 11.2617825646957 12.4777480603344 14.0643342489519 5.8200930075659 17.1807744205099 25.4135583827285 26.5295527926365 20.2169052093875 6.8672594091851 8.47360368175028 18.6354272083273 3.27922750710809 20.395511059708 25.0638523444653 26.3567900342152 20.056298491639 3.39853501036095 4.85205532263505 22.8225627680594 1.59087513854754 23.8239602910703 22.7037853597417 25.9190400462628 27.3040937786131 1.77869741217291 1.42540118548504 26.0957423738615
                InputStat.DataCovar  = ExtractDoubleArrayFromString(file.ReadLine()); //InputCovar : 14.6093625808533 50.2306523380979 0.178199330932363 29.2345174583603 0.0442749059013011 4.51223356288581 0.244527459116665 9.74388014569309 6.79608239810571 36.9735608666003 2.02657169661311 37.7179403193707 0.42083045258324 7.28013594356971 1.98501192862816 5.12591581098703 4.83550408708377 39.5013259613223 5.90226047824132 37.7385039735158 0.776528429481726 7.51532814194753 5.47315721585702 2.98807287644095 10.2357729065205 39.0621908271587 11.1431131506145 29.1889747835245 1.601032140665 5.45608369503981 10.3571065599548 2.66876098853281 12.0790376570955 43.9092451903965 16.6554111865978 18.0397327648148 2.02704246209531 4.58294353667648 13.199193120711 3.03309816378168 6.63293653650937 51.4219808500456 24.5659426765884 9.22114173063598 1.30403007536136 4.92427880535377 15.2961259877497 2.13285219828918 6.62699524475637 39.1509001901378 32.7596749754202 3.68861200473408 0.863314741065272 2.18911663253458 17.4837450587228 1.18922371584034 18.1683139728303 35.1078097890218 33.7718377133711 0.353625270019286 3.15385787689156 0.267068800993306 16.4864505773026 0.109401512214491 38.1104243986685 15.3570759088234 0.250026221307705 22.9598968087044 0.234845285088301 3.26076005677911 0.0899236918609054 14.0765293266514 40.0348823953438 7.15576814043582 2.84199805919824 25.7508972626266 1.96625866726478 0.681249000981847 1.40239616758681 17.8434754868313 60.1550063053171 5.05237792251719 7.00552242633507 22.5061168524175 4.25286614498984 0.977907164174485 3.60223165053665 15.765117756651 58.3699311237968 11.6920275985771 13.4697165067102 15.7320763608043 4.09638945040802 2.27346970325718 4.33461013666981 12.921288916159 51.0031399069609 12.9182648119426 22.3198745699191 11.4195814564082 5.01749421709395 2.75583653773422 3.15184106301432 10.3927710285607 57.0664187427617 6.85456911023899 32.5274907048536 7.3057807363474 6.95154547083511 1.68830229006611 2.92076743906056 6.27226198601912 53.2458611273462 7.56518727051969 37.439924683847 3.00017524279826 7.40221129500128 0.789341532384131 3.56676357235023 2.37917749979293 53.3840223380813 18.8757048169535 36.7992555104595 0.298838117971846 6.1462742699294 0.0808791849219355 7.87637959905946 0.325322521503953 28.74617455395 0.299955221793253 22.8395890079054 59.5899390731626 0.251401594327009 4.88713657789469 12.6740756758558 0.0483916006972026 31.3428687103619 2.91658549725137 28.1245345535024 40.8706576317855 2.35562631825144 2.4879261131158 8.3737041379698 1.90809820993725 22.9059019025455 7.7199376266363 11.1979461745656 42.7370684196202 5.56734175758416 2.04666743969787 8.2661569698814 3.32766611735423 14.7240567404187 15.8557729152406 15.0363304682807 34.0536568710945 4.51304544427547 1.67008281264181 8.46391103202995 2.80897799849957 9.73272553934134 25.9563658019747 13.9181861152177 35.3547121331812 4.86363008822858 1.50624093916649 8.29245822137596 3.16853745339415 6.22335945532636 36.2994011747468 11.8608602312427 51.2371985310445 5.91659052507279 0.940208240192041 6.22260334530433 5.66970731827867 2.71109725998541 40.6960115995332 18.843267743755 71.4778290015817 6.27869462364813 0.480063957591782 2.49532926628559 8.89651336721982 0.269643248739793 38.1960136187864 14.1934243630612 88.4479325657733 6.32476398105946 0.0360892939659446 0.257700380436071 12.72260161663 26.1101224428706 0.240321436887901 79.2452232309264 19.8488451507091 0.0347029735332047 5.20094396370936 15.6682757361332 0.249131434568349 28.4640771446298 2.42965868946958 60.1855102897683 26.618432155778 0.760721136738825 5.40427460490595 8.57214007865234 2.06916725066601 27.000906901989 5.24956029699029 49.6469590011429 11.4113774316714 1.83319189189321 4.73728210812653 5.2562763356679 5.82352656309848 21.5796021043595 8.68733485856521 49.3970028439191 12.5442334263744 2.52838291526947 3.88527654176404 3.42904764457878 10.0907285981651 13.8179951139726 14.5131004974694 51.4379277693356 12.542327602816 1.59523795855243 3.88865568709618 4.4931226286375 11.3755175065114 7.60983445233934 22.1931199679575 45.5235112933835 10.9217779504562 0.864070871405893 4.36278328960515 4.15467225274215 9.94064638753762 2.96852072270915 28.9591768760654 48.6263623749949 16.9771566808405 1.28663880232976 2.19287578739885 1.58761311939114 10.7211183129484 0.291284502312329 32.3168547030646 72.2490027063789 13.4199490278887 3.90917448477223 0.252363051951754 0.0663110710389982 13.4728312533724
                ii = ExtractIntFromString(file.ReadLine());
                InputTransformType = (TDataTransformType)ii;                          //InputTransformType :8
                file.ReadLine();                                                      //TargetMean :
                file.ReadLine();                                                      //TargetMaxDev :
                file.ReadLine();                                                      //TargetCovar :
                file.ReadLine();                                                      //TargetTransformType :3
                OutputToPatt = ExtractIntArrayFromString(file.ReadLine());            //OutputToPatt : 0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900

                for (int l = 1; l < Nl.Length; l++)
                {
                    for (int j = 0; j < Nl[l]; j++)
                    {
                        file.ReadLine();                                              //Neuron : 1 0
                        file.ReadLine();                                              //Connected : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
                        file.ReadLine();                                              //WeightsType : 0
                        file.ReadLine();                                              //WeightsShareNeuron : 0
                        Layer[l].Neuron[j].Weight =
                            ExtractDoubleArrayFromString(file.ReadLine());            //Weights : -0.0410893015090431 -0.0668463279663241 -0.172689198865961 -0.00739713552760065 -0.0790540843073554 -0.176671586813184 -0.135202770209815 0.233481473374488

                        Layer[l].Neuron[j].Bias =
                            ExtractDoubleFromString(file.ReadLine());                                     //Bias : -1.22778531444948
                    }
                }
            }
Exemple #2
0
        static void BuildPuzzle()
        {
            try
            {
                g.Seed = 1;
                _lyr   = new cLayer();

                CreateValidationLists();
            }
            catch (Exception x)
            {
                Console.WriteLine(x.Message);
            }
        }
Exemple #3
0
            public cNetFF(int[] aNl)
            {
                LayerCount = aNl.Length - 1;
                Nl         = new int[aNl.Length];
                Input      = new double[aNl[0]];
                Output     = new double[aNl[aNl.Length - 1]];
                Layer      = new cLayer[aNl.Length];

                IsStatCalculated = false;

                for (int i = 0; i < aNl.Length; i++)
                {
                    Layer[i] = new cLayer(aNl[i]);
                    Nl[i]    = aNl[i];
                }

                for (int l = 1; l < Layer.Length; l++)
                {
                    for (int j = 0; j < Layer[l].Neuron.Length; j++)
                    {
                        Layer[l].Neuron[j].setWeight(aNl[l - 1]);
                    }
                }
            } // cNetFF