Exemple #1
0
 private void CheckChromosome()
 {
     if (Chromosome == null)
     {
         Chromosome = new float[LayersList.Sum(x => x.TotalParamCount)];
     }
 }
Exemple #2
0
        private EvolvableNet(EvolvableNet other) : base(other)
        {
            Fitness    = other.Fitness;
            Chromosome = new float[LayersList.Sum(x => x.TotalParamCount)];
            other.Chromosome.CopyTo(Chromosome, 0);

            //clones have different IDs!
            Id = GetId();
        }
Exemple #3
0
        public EvolvableNet(int xSize, int hSize, int ySize)
            : base(1, 1, new GruLayer <float>(xSize, hSize),
                   new LinearLayer <float>(hSize, ySize),
                   new SoftMaxLayer <float>(ySize))
        {
            Chromosome = new float[LayersList.Sum(x => x.TotalParamCount)];

            Id = GetId();
        }