/// <summary>
    /// Create a new instance of <see cref="INeatExperiment{T}"/>.
    /// </summary>
    /// <param name="configElem">Experiment config in json form.</param>
    /// <returns>A new instance of <see cref="INeatExperiment{T}"/>.</returns>
    public INeatExperiment <double> CreateExperiment(JsonElement configElem)
    {
        // Create an evaluation scheme object for the binary 11-multiplexer task.
        var evalScheme = new BinaryElevenMultiplexerEvaluationScheme();

        // Create a NeatExperiment object with the evaluation scheme,
        // and assign some default settings (these can be overridden by config).
        var experiment = new NeatExperiment <double>(evalScheme, this.Id)
        {
            IsAcyclic        = true,
            ActivationFnName = ActivationFunctionId.LeakyReLU.ToString()
        };

        // Read standard neat experiment json config and use it configure the experiment.
        NeatExperimentJsonReader <double> .Read(experiment, configElem);

        return(experiment);
    }
Ejemplo n.º 2
0
        private IGenomeListEvaluator <NeatGenome <double> > CreateGenomeListEvaluator(
            out int inputCount, out int outputCount)
        {
            var genomeDecoder = NeatGenomeDecoderFactory.CreateGenomeAcyclicDecoder(true);
            IBlackBoxEvaluationScheme <double> blackBoxEvaluationScheme = new BinaryElevenMultiplexerEvaluationScheme();

            //// Create function regression evaluation scheme.
            //int sampleResolution = 20;
            //double sampleMin = 0;
            //double sampleMax = 6.283185;
            //var paramSamplingInfo = new ParamSamplingInfo(sampleMin, sampleMax, sampleResolution);
            //IBlackBoxEvaluationScheme<double> blackBoxEvaluationScheme = new FuncRegressionEvaluationScheme(FunctionFactory.GetFunction(FunctionId.Sin), paramSamplingInfo, 0.3);

            var genomeListEvaluator = GenomeListEvaluatorFactory.CreateEvaluator(
                genomeDecoder,
                blackBoxEvaluationScheme,
                createConcurrentEvaluator: true);

            inputCount  = blackBoxEvaluationScheme.InputCount;
            outputCount = blackBoxEvaluationScheme.OutputCount;
            return(genomeListEvaluator);
        }