public static neuralnet cross(neuralnet a, neuralnet b, int nr_cat)
        {
            neuralnet aux = new neuralnet(a);
            int       piv = (a.layers.Count + b.layers.Count) / (2 * nr_cat);


            for (int i = piv; i < b.size; i++)
            {
                if (i > aux.size)
                {
                    aux.layers.Add(new layer());
                }
                aux.layers[i].schimba(b.layers[i]);
            }

            foreach (node n in aux.layers[piv].nodes)
            {
                while (n.conexiuni.Count > aux.layers[piv - 1].size)
                {
                    n.conexiuni.RemoveAt(n.conexiuni.Count);
                }
                while (n.conexiuni.Count < aux.layers[piv - 1].size)
                {
                    n.conexiuni.Add(Random.Range(-100f, 100f));
                }
            }


            return(aux);
        }
 public neuralnet(neuralnet n)
 {
     this.input_size = n.input_size;
     this.layers     = n.layers;
     this.size       = n.size;
 }