нейронная сеть — PHP Энн не обучается после определенного шага

Я использую Codeİgniter. Я создаю помощника ANN, и этот помощник работает. Но Энн не обучена после определенного шага.

и обучение 0.5 сети, но мой запрос не 0.5 для обучения $ exit var.

        public function index() {
$this->load->helper('ann');

/* Besiktas , Fenerbahce and galatasaray team data */
$bjkdata=array("0.72","0.576","0.42","0.53","0.79","0.768","0.728","0.574","0.745","0.754","0.703","0.38");
$fbdata=array("0.58","0.426","0.416","0.510","0.75","0.725","0.696","0.581","0.693","0.701","0.640","0.41");
$gsdata=array("0.91","0.243","0.703","0.643","0.80","0.733","0.7","0.603","0.712","0.690","0.627","0.41");

/*
* Another Data
*/
$anotherdata=array("0.8","0.1","0.1");
/*
* Way's
*/
$way=array("0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01","0.01");

/*
* Createing a class
*/
$homewin=new ANN;

/*
* train network with same data , 50 steps or another number .
*/
for ($i=0; $i < 50; $i++) {
$way=$homewin->train_network_for_homewin($bjkdata,$fbdata,$anotherdata,$way,"0.782");
}

}

и мой вспомогательный файл;

    public function train_network_for_homewin($team1data,$team2data,$anotherdata,$way,$exit) {
$feedbackvar=0.2;

// hidden layer input's
$crcle[1]=$team1data[0]*$way[0]+$team1data[1]*$way[1]+$team1data[2]*$way[2]+$team1data[3]*$way[3];
$crcle[2]=$team1data[4]*$way[4];
$crcle[3]=$team1data[5]*$way[5]+$team1data[6]*$way[6]+$team1data[7]*$way[7]+$team1data[8]*$way[8]+$team1data[9]*$way[9]+$team1data[10]*$way[10];

$crcle[4]=$anotherdata[0]*$way[11]+$anotherdata[1]*$way[12]+$anotherdata[2]*$way[13];

$crcle[5]=$team2data[11]*$way[14]+$team2data[1]*$way[15]+$team2data[2]*$way[16]+$team2data[3]*$way[17];
$crcle[6]=$team2data[4]*$way[18];
$crcle[7]=$team2data[5]*$way[19]+$team2data[6]*$way[20]+$team2data[7]*$way[21]+$team2data[8]*$way[22]+$team2data[9]*$way[23]+$team2data[10]*$way[24];

// hidden layer tansig activation
for ($i=1; $i < 8; $i++) {
$hidden_layer_one[$i]=$this->tansig_transfer_function($crcle[$i]);
}

// exit layer input
$exit_first=0;
for ($j=1; $j < 8; $j++) {
$exit_first+=($hidden_layer_one[$j]*$way[24+$j]);
}


$exit_last=$this->logsig_transfer_function($exit_first);



// Error %s
$e[1]=$hidden_layer_one[1]*($exit-$hidden_layer_one[1]);
$e[2]=$hidden_layer_one[2]*($exit-$hidden_layer_one[2]);
$e[3]=$hidden_layer_one[3]*($exit-$hidden_layer_one[3]);
$e[4]=$hidden_layer_one[4]*($exit-$hidden_layer_one[4]);
$e[5]=$hidden_layer_one[5]*($exit-$hidden_layer_one[5]);
$e[6]=$hidden_layer_one[6]*($exit-$hidden_layer_one[6]);
$e[7]=$hidden_layer_one[7]*($exit-$hidden_layer_one[7]);
$e[8]=$exit_last*($exit-$exit_last)*($exit-$exit_last);


// Back probogation
$way[0]=$way[0]+($e[1]*$feedbackvar*$team1data[0]);
$way[1]=$way[1]+($e[1]*$feedbackvar*$team1data[1]);
$way[2]=$way[2]+($e[1]*$feedbackvar*$team1data[2]);
$way[3]=$way[3]+($e[1]*$feedbackvar*$team1data[3]);

$way[4]=$way[4]+($e[2]*$feedbackvar*$team1data[4]);

$way[5]=$way[5]+($e[3]*$feedbackvar*$team1data[5]);
$way[6]=$way[6]+($e[3]*$feedbackvar*$team1data[6]);
$way[7]=$way[7]+($e[3]*$feedbackvar*$team1data[7]);
$way[8]=$way[8]+($e[3]*$feedbackvar*$team1data[8]);
$way[9]=$way[9]+($e[3]*$feedbackvar*$team1data[9]);
$way[10]=$way[10]+($e[3]*$feedbackvar*$team1data[10]);

$way[11]=$way[11]+($e[4]*$feedbackvar*$anotherdata[0]);
$way[12]=$way[12]+($e[4]*$feedbackvar*$anotherdata[1]);
$way[13]=$way[13]+($e[4]*$feedbackvar*$anotherdata[2]);

$way[14]=$way[14]+($e[5]*$feedbackvar*$team2data[11]);
$way[15]=$way[15]+($e[5]*$feedbackvar*$team2data[1]);
$way[16]=$way[16]+($e[5]*$feedbackvar*$team2data[2]);
$way[17]=$way[17]+($e[5]*$feedbackvar*$team2data[3]);

$way[18]=$way[18]+($e[6]*$feedbackvar*$team2data[4]);

$way[19]=$way[19]+($e[7]*$feedbackvar*$team2data[5]);
$way[20]=$way[20]+($e[7]*$feedbackvar*$team2data[6]);
$way[21]=$way[21]+($e[7]*$feedbackvar*$team2data[7]);
$way[22]=$way[22]+($e[7]*$feedbackvar*$team2data[8]);
$way[23]=$way[23]+($e[7]*$feedbackvar*$team2data[9]);
$way[24]=$way[24]+($e[7]*$feedbackvar*$team2data[10]);

$way[25]=$way[25]*($e[8]*$feedbackvar*$hidden_layer_one[1]);
$way[26]=$way[26]*($e[8]*$feedbackvar*$hidden_layer_one[2]);
$way[27]=$way[27]*($e[8]*$feedbackvar*$hidden_layer_one[3]);
$way[28]=$way[28]*($e[8]*$feedbackvar*$hidden_layer_one[4]);
$way[29]=$way[29]*($e[8]*$feedbackvar*$hidden_layer_one[5]);
$way[30]=$way[30]*($e[8]*$feedbackvar*$hidden_layer_one[6]);
$way[31]=$way[31]*($e[8]*$feedbackvar*$hidden_layer_one[7]);


return $way;



}

public function tansig_transfer_function($data) {

return 2/(1+exp(-2*$data))-1;

}

public function logsig_transfer_function($data) {

return 1/(1+exp(-1*$data));

}

и я запускаю скриншоты;
доля ошибок (последняя — это значение выхода из сети): php ann ошибка делится

а также

Значения выхода из сети: значения выхода из сети php ann

почему выходное значение сети остается постоянным после определенного шага и почему оно тренируется на 0,5?

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]