public LearningProcess LoadLearningProcess(string path)
    {
        if (path == null || !File.Exists(path))
        {
            return(null);
        }

        learningProcess = Serializator.Deserialize(path);

        if (learningProcess == null)
        {
            throw new Exception("Błąd deserializacji!!!");
        }

        config = learningProcess.LearningAlgorithm.Config;
        parentChoosingMethod = config.ParentMethod;
        sigma = (float)config.RandOptions.Sigma;

        PercentToSelect = (float)config.PercentToSelect;
        MutationChance  = (float)config.MutationChance;

        List <Type> neuronTypes = new List <Type>();

        foreach (LayerBase <double> neuron in learningProcess.Population[0].Layers)
        {
            neuronTypes.Add(neuron.Neurons[0].GetType());
        }

        Debug.Log(learningProcess.Population[0].Layers[0].Neurons[0]);


        neuronDefinitionsPanelScript.
        SetNeuronDefinitions(
            learningProcess.Population[0].LayersCount,
            neuronTypes
            );

        //plot.PreviousLearningProcess(learningProcess);
        plot.RestartedSimulation(learningProcess);


        ProcessData[] histData = new ProcessData[learningProcess.HistoricalData.Count];
        learningProcess.HistoricalData.CopyTo(histData);
        GenerationList.SetGenerationHistory(new List <ProcessData>(histData));

        return(learningProcess);
    }
Exemple #2
0
        public static Func <int, double[], int[]> Get(ParentChoosingMethod method)
        {
            switch (method)
            {
            case ParentChoosingMethod.PositionLinear:
                return(PositionLinear);

            case ParentChoosingMethod.ScoreLinear:
                return(ScoreLinear);

            case ParentChoosingMethod.ScoreCubic:
                return(ScoreCubic);

            case ParentChoosingMethod.PositionCubic:
                return(PositionCubic);

            case ParentChoosingMethod.PositionExponential:
                return(PositionExponential);

            case ParentChoosingMethod.Geom:
                return(Geom);
            }
            return(PositionLinear);
        }
Exemple #3
0
 public void SetParentChoosingMethod(ParentChoosingMethod method)
 {
     ParentMethod = method;
     Reinitialize();
 }
 public void SetParentChoosingMethod(ParentChoosingMethod meth)
 {
     parentChoosingMethod = meth;
 }