fuflon4ik
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Вот так Код: html://localhost/my-cgi.exe | у меня не получалось. В httpd.conf сделал изменения Код: <Directory "C:/xampp/cgi-bin"> AllowOverride All Options ExecCGI Require all granted </Directory> | Файл my-cgi.exe переименовал в my-cgi.cgi и разместил в папке cgi-bin Отзывается приблуда на запрос Код: html://localhost/cgi-bin/my-cgi.cgi | отдаёт вот такую фигню бесконечно Код: Enter Input values for Step 1 Input-1: Enter Input values for Step 2 Input-2: Enter Input values for Step 3 Input-3: Enter Input values for Step 4 Input-4: Enter Input values for Step 5 Input-5: Enter Input values for Step 6 Input-6: Enter Input values for Step 7 Input-7: Enter Input values for Step 8 Input-8: Enter Input values for Step 9 Input-9: Enter Input values for Step 10 Input-10: Enter Input values for Step 11 Input-11: Enter Input values for Step 12 Input-12: Enter Input values for Step 13 Input-13: Predicted Output of Var1 = 7.57698205884847e-001 Press any key to make another prediction or enter 0 to quit the program. .... | Ввод мне совсем просто организовать. У меня все скрипты работают на HumanEmulator - прога эмуляторует работу IE. Формирую php-скриптом строку get-запроса и отсылаю одной командой. Код: $browser->navigate("html://localhost/cgi-bin/my-cgi.cgi?a=1.23&b=4.56&c=7.89&..."); | ne_viens, спасибо за код. Сам бы фиг знает когда допёр! а=1.23 Можно в запросе, наверное, и просто (int) передавать a=1; в Си %lg сделает 1.0 Правильно? На этом месте разместить весь код из Statistica? Код: Вот этот стало быть: Код: //Analysis Type - TS_Reg #include <stdio.h> #include <conio.h> #include <math.h> #include <stdlib.h> double mlp13_1_MLP_13_13_1_input_hidden_weights[13][13]= { {1.47407648542626e+001, 2.33845220995096e+001, -1.04770236272556e+001, 5.01251247381029e+000, -1.16872256980475e+001, 6.06400721390822e+000, 1.98867672183470e+001, 7.24977961596758e+000, 6.06329443538565e+000, -2.27023958084731e+001, 7.17999260249275e+000, -8.21042578691309e+000, 9.99977990807445e+000 }, {1.50247542521186e+001, 1.61358250858326e+001, -6.60608375185050e+000, 1.04553117348800e+000, -1.01693896997886e+001, 5.10767505115569e+000, 1.81654635093651e+001, 4.44988990773362e+000, 2.69488312896401e+000, -1.76438170982698e+001, 2.31208214040402e+000, -7.53907000493838e+000, 7.54463191331732e+000 }, {1.83670445700344e+001, 2.61545610377644e+001, -1.11357677815262e+001, 9.61624281189545e-001, -1.11438967060773e+001, 8.15507366018540e+000, 2.20640382156643e+001, 5.23153754811687e+000, 7.34980407765515e+000, -2.43172900253632e+001, 5.82258278950657e+000, -7.15921709850011e+000, 7.18970292893705e+000 }, {1.20683004588163e+001, 1.99254715047526e+001, -3.23510529729366e+000, 1.56711147150273e+000, -6.49198127334141e+000, 8.46486381869495e+000, 1.55643928193987e+001, 6.65056919046755e+000, 8.06934573467628e+000, -1.49092120933729e+001, 5.91159907296848e+000, -1.87544342770366e+000, 6.13047149142282e+000 }, {1.47737348933845e+001, 1.87257063721578e+001, -8.28883338152251e+000, 2.14643219774649e+000, -1.14497002923097e+001, 5.90723179006765e+000, 1.95231776265854e+001, 5.91054213535935e+000, 2.98324603699531e+000, -2.08684006022125e+001, 3.86181264571278e+000, -8.59777255699946e+000, 8.86183982530557e+000 }, {1.42308345990049e+001, 2.26507647138286e+001, -7.70734485892200e+000, 3.60666882547971e+000, -8.90497462110844e+000, 6.81127770729695e+000, 1.78967901069351e+001, 6.51744070763824e+000, 7.19434889834124e+000, -2.05569684217155e+001, 6.62996921711290e+000, -5.89046518111476e+000, 7.81323256195222e+000 }, {1.69204432645604e+001, 2.15152680655102e+001, -8.55015992836767e+000, 4.10822214006381e+000, -1.24477622156189e+001, 7.21272993074916e+000, 1.93299916756462e+001, 5.41718013796092e+000, 5.16077941392651e+000, -2.03214919824887e+001, 4.74770299094491e+000, -5.83865054982091e+000, 9.85558116330294e+000 }, {1.46680755546602e+001, 2.42473642201510e+001, -1.25051505701016e+001, 2.52208522997699e+000, -1.29219850966483e+001, 7.57072219401321e+000, 2.15288259206424e+001, 6.13591950786286e+000, 5.00971039224947e+000, -2.55858759779316e+001, 6.30163960870771e+000, -9.57202950674167e+000, 1.01713740459485e+001 }, {2.04196306154551e+001, 1.92818987179054e+001, -2.54710449806711e+000, 7.61621366853230e+000, -1.01787658754317e+001, 9.31402616774368e+000, 1.67371412687609e+001, 3.44213205035471e+000, 3.18634446717204e+000, -1.99290963654038e+001, 3.60156089336685e+000, -4.13534891196105e+000, 8.37964731006887e+000 }, {1.30017218622539e+001, 2.15860167046120e+001, -6.26690603980805e+000, 2.95715829273427e+000, -8.28866501434538e+000, 7.23946058407366e+000, 1.67907958194882e+001, 7.64759080409137e+000, 7.55075268227800e+000, -1.92848890482642e+001, 6.08305660382604e+000, -4.34364335739862e+000, 7.58560986339976e+000 }, {1.53526292297582e+001, 2.11431411328668e+001, -4.30697262571824e+000, 2.00169453723569e+000, -8.26836611596593e+000, 8.10571682914985e+000, 1.68059687747551e+001, 4.87710469496919e+000, 6.37635700737915e+000, -1.96383226612622e+001, 4.76385116089051e+000, -3.25027180698683e+000, 6.73953252095038e+000 }, {1.51441758583112e+001, 2.06202809790832e+001, -6.95218269811313e+000, 1.81188801466805e+000, -8.85504718097442e+000, 6.96795043813840e+000, 1.77739371445652e+001, 3.95262304256654e+000, 5.29589729208152e+000, -2.00137248530176e+001, 4.50241299767116e+000, -5.04258683756410e+000, 6.88212369672247e+000 }, {2.79895984367778e+001, 2.52804991021659e+001, -1.78094653944134e+000, 7.41131042498682e+000, -1.35940218111333e+001, 1.31850789803742e+001, 2.12149330432975e+001, 2.89461266860938e+000, 2.73941350582567e+000, -2.89994534045504e+001, 3.62786240443848e+000, -1.07763280840423e+001, 1.04718932217083e+001 } }; double mlp13_1_MLP_13_13_1_hidden_bias[13]={ 2.98219600691602e+000, 5.14419893800076e-001, -2.08741839088994e+000, 8.74392213615861e+000, 2.39356246237662e-001, 5.20741324096698e+000, 2.56060501533835e+000, -1.87452016034769e+000, 9.07199843185434e+000, 6.88099225641089e+000, 5.06781234369446e+000, 3.08189442968142e+000, 8.89978690980278e+000 }; double mlp13_1_MLP_13_13_1_hidden_output_wts[1][13]= { {1.25158426985695e+000, -2.02462393766533e+000, 5.14771462899196e+000, -7.68589400157939e+000, -1.67705584522174e+000, -5.96819126863642e-001, 1.57737564636523e+000, -2.47675056340303e+000, 5.72433533049534e+000, -4.18277387828710e+000, -4.95349505533110e+000, -3.02313570001016e+000, 1.44962794719505e+001 } }; double mlp13_1_MLP_13_13_1_output_bias[1]={ -3.74733359861593e+000 }; double mlp13_1_MLP_13_13_1_max_input[1]={ 1.70000000000000e+001 }; double mlp13_1_MLP_13_13_1_min_input[1]={ 0.00000000000000e+000 }; double mlp13_1_MLP_13_13_1_max_target[1]={ 1.70000000000000e+001 }; double mlp13_1_MLP_13_13_1_min_target[1]={ 0.00000000000000e+000 }; double mlp13_1_MLP_13_13_1_input[13]; double mlp13_1_MLP_13_13_1_hidden[13]; double mlp13_1_MLP_13_13_1_output[1]; double mlp13_1_MLP_13_13_1_MeanInputs[1]={ 2.38730158730159e+000 }; void mlp13_1_MLP_13_13_1_ScaleInputs(double* input, double minimum, double maximum, int nContTargets, int steps) { double delta; long i,j; for(i=0; i<nContTargets; i++) { delta = (maximum-minimum)/(mlp13_1_MLP_13_13_1_max_input[i]-mlp13_1_MLP_13_13_1_min_input[i]); for(j=0; j<steps; j++) input[i+j*nContTargets] = minimum - delta*mlp13_1_MLP_13_13_1_min_input[i]+ delta*input[i+j*nContTargets]; } } void mlp13_1_MLP_13_13_1_UnscaleTargets(double* output, double minimum, double maximum, int size) { double delta; long i; for(i=0; i<size; i++) { delta = (maximum-minimum)/(mlp13_1_MLP_13_13_1_max_target[i]-mlp13_1_MLP_13_13_1_min_target[i]); output[i] = (output[i] - minimum + delta*mlp13_1_MLP_13_13_1_min_target[i])/delta; } } double mlp13_1_MLP_13_13_1_logistic(double x) { if(x > 100.0) x = 1.0; else if (x < -100.0) x = 0.0; else x = 1.0/(1.0+exp(-x)); return x; } void mlp13_1_MLP_13_13_1_ComputeFeedForwardSignals(double* MAT_INOUT,double* V_IN,double* V_OUT, double* V_BIAS,int size1,int size2,int layer) { int row,col; for(row=0;row < size2; row++) { V_OUT[row]=0.0; for(col=0;col<size1;col++)V_OUT[row]+=(*(MAT_INOUT+(row*size1)+col)*V_IN[col]); V_OUT[row]+=V_BIAS[row]; if(layer==0) V_OUT[row] = mlp13_1_MLP_13_13_1_logistic(V_OUT[row]); if(layer==1) V_OUT[row] = exp(V_OUT[row]); } } void mlp13_1_MLP_13_13_1_RunNeuralNet_TS_Reg () { mlp13_1_MLP_13_13_1_ComputeFeedForwardSignals((double*)mlp13_1_MLP_13_13_1_input_hidden_weights,mlp13_1_MLP_13_13_1_input,mlp13_1_MLP_13_13_1_hidden,mlp13_1_MLP_13_13_1_hidden_bias,13, 13,0); mlp13_1_MLP_13_13_1_ComputeFeedForwardSignals((double*)mlp13_1_MLP_13_13_1_hidden_output_wts,mlp13_1_MLP_13_13_1_hidden,mlp13_1_MLP_13_13_1_output,mlp13_1_MLP_13_13_1_output_bias,13, 1,1); } int main() { int i=0; int keyin=1; int stepcntr; int inputindex; int nsteps; while(1) { stepcntr=1; inputindex=0; for(nsteps=0;nsteps<13;nsteps++) { printf("\n%s%d\n","Enter Input values for Step ",stepcntr++); printf("%s%d%s","Input-",inputindex+1,": "); scanf("%lg",&mlp13_1_MLP_13_13_1_input[inputindex]); //Substitution of missing continuous variables if(mlp13_1_MLP_13_13_1_input[inputindex] == -9999) mlp13_1_MLP_13_13_1_input[inputindex]=mlp13_1_MLP_13_13_1_MeanInputs[0]; inputindex++; } mlp13_1_MLP_13_13_1_ScaleInputs(mlp13_1_MLP_13_13_1_input,0,1,1,13); mlp13_1_MLP_13_13_1_RunNeuralNet_TS_Reg(); mlp13_1_MLP_13_13_1_UnscaleTargets(mlp13_1_MLP_13_13_1_output,0,1,1); printf("\n%s%.14e","Predicted Output of Var1 = ",mlp13_1_MLP_13_13_1_output[0]); printf("\n\n%s\n","Press any key to make another prediction or enter 0 to quit the program."); keyin=getch(); if(keyin==48)break; } return 0; } | Буду пробовать. Ёмоё не могу отредактировать сообщение... | Всего записей: 61 | Зарегистр. 06-03-2013 | Отправлено: 16:50 31-12-2015 | Исправлено: fuflon4ik, 16:57 31-12-2015 |
|