I am working with neural networks, and I want to create the weights randomly. SO if I create 30 Neural networks every single one of them ends up having the same weights(supposed to be random) so when i give them all the same input the output is the same, when it shouldn't. Any help?

Here is the main function

```
int main(){
std::vector<Improved_NN> v;
std::random_device rd;
std::default_random_engine generator(rd());
std::uniform_real_distribution<double> distribution(-1.0,1.0);
for(int i = 0; i < 30; i++)
{
    Improved_NN temp;
    temp.initialize_weights(generator, distribution);
    v.push_back(temp);
}

Board temp;

for(int i = 0; i < 30; i++)
{
    std::cout <<"\n" << v[i].executeFromExternal(temp);
}

```

And the initialize\_weights is here:

```
 void Improved_NN::initialize_weights(std::default_random_engine gen,std::uniform_real_distribution<double> dist){
int k,v = 0;
for(k = 0;k<NUM_HIDDEN_1;k++){
    for(v = 0 ; v < NUM_INPUTS; v++){
        mlp_t.w_h1_i[k][v]=dist(gen);
        //std::cout<<mlp_t.w_h1_i[k][v]<<std::endl;
    }
}
for(k = 0;k<NUM_HIDDEN_2;k++){
    for(v = 0 ; v < NUM_HIDDEN_1; v++){
        mlp_t.w_h2_h1[k][v]=dist(gen);
        //std::cout<<mlp_t.w_h2_h1[k][v]<<std::endl;
    }
}
for(k = 0;k<NUM_HIDDEN_3;k++){
    for(v = 0 ; v < NUM_HIDDEN_2; v++){
        mlp_t.w_h3_h2[k][v]=dist(gen);
        //std::cout<<mlp_t.w_h3_h2[k][v]<<std::endl;
    }
}
    for (int a = 0 ; a < NUM_HIDDEN_3;a++){
        mlp_t.w_o_h[0][a] = dist(gen);
        //std::cout<<mlp_t.w_o_h[0][a]<<std::endl;
    }
}

```

This is the output i get every time i execute.

0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458
0.521458

Thank you very much.