예제 #1
0
        public override Phenotype Clone(Phenotype otherParent)
        {
            //Assume to be another phenotype group
            SequentialModel modelParent = (SequentialModel)otherParent;

            ComputationModel[] modelClones = new ComputationModel[computationModels.Length];
            for (int i = 0; i < modelClones.Length; i++)
            {
                modelClones[i] = (ComputationModel)computationModels[i].Clone(modelParent.ComputationModels[i]);
            }

            return(new SequentialModel(modelClones));
        }
        public void AddModel(ComputationModel model)
        {
            int[] nextInputShape;
            if (computationModels.Count != 0)
            {
                nextInputShape = computationModels[computationModels.Count - 1].OutputShape;
            }
            else
            {
                nextInputShape = this.inputShape;
            }

            model.Deploy(nextInputShape);
            computationModels.Add(model);
        }