# Neural network with multiple layer: learning function

Here is my code to implement the learning of my neural network using the backpropagation learning. The algorithms is stable but I don't learn correctly the output. Do you see anything wrong in my learning process?

//### Parameter ###
#define Nb_entry 2
#define coeff_app 0.01
#define par_momentum 0.8
#define par_nb_test 0.2
#define para_tolerence 0.05
#define para_stop_learning 1000


Here are my learning functions

void fonction_neuron(double * input, Neuron * neuron_info)
{
int i=0; // loop variable
double net=0;

// Computation of the net value type: net = w*bias + sum(w[i]*imp[i])
net=(*neuron_info).weight; //bias = 1
for(i=1;i<(*neuron_info).nb_input;i++) net+=(*neuron_info).weight[i]*input[i];

(*neuron_info).output=net;
//print_stat_neuron(neuron_info);
}

void fonction_network(Neuron N_network[], int nb_layer, int *nb_neuron_per_layer,double *input)
{
int i,j; //loop variable
double previous_layer_output={0};

//Propagation of the signal into the neural network
for(i=0;i<nb_layer;i++)
{
if(i!=0) for(j=0;j<nb_neuron_per_layer[i-1];j++)
{
previous_layer_output[j]=N_network[i-1][j].output;//save previous layer output
//printf("previous_layer_output[%d]=%f\n",j,previous_layer_output[j]);
}

for(j=0;j<nb_neuron_per_layer[i];j++)
{
//printf(" i=%d j=%d \n", i,j);
N_network[i][j].old_output=N_network[i][j].output; //save previous value
if(i==0)fonction_neuron(input, &(N_network[i][j])); //first layer
else fonction_neuron(previous_layer_output, &(N_network[i][j])); //other layer using the previous layer output
}
}
}

• regarding this line: double net=0; the posted code exhibits several details that. individually, might not matter, but do indicate problems. For instance, a literal value being assigned to a double. The literal value is expected to contain a decimal point. so the line should be: double net=0.0; – user3629249 Dec 22 '15 at 17:50
• for readability by us humans, strongly suggest following the axiom: only one statement per line and (at most) one variable declaration per statement. – user3629249 Dec 22 '15 at 17:57
• for those of us that are very good with 'C' but do not know the Neural network with multiple layer: learning function algorithm, could you post a link to that algorithm. – user3629249 Dec 22 '15 at 18:02

5- If you choose the sigmoid and backpropagation, here is an example algorithm (this algorithm the derivative of the sigmoid is already calculated $O_{j}$ $(1-O_{j})$.