/// <summary>
        /// Creates a new instance of <see cref="INeatExperiment{T}"/> using experiment configuration settings
        /// from the provided json object model.
        /// </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 3-multiplexer task.
            var evalScheme = new BinaryThreeMultiplexerEvaluationScheme();

            // 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);
        }
示例#2
0
        /// <summary>
        /// Create a new instance of <see cref="INeatExperiment{T}"/>.
        /// </summary>
        /// <param name="jsonConfig">Experiment config in json format.</param>
        /// <returns>A new instance of <see cref="INeatExperiment{T}"/>.</returns>
        public INeatExperiment <double> CreateExperiment(string jsonConfig)
        {
            // Parse the json config string.
            JObject configJobj = JsonUtils.Parse(jsonConfig);

            // Create an evaluation scheme object for the binary 3-multiplexer task.
            var evalScheme = new BinaryThreeMultiplexerEvaluationScheme();

            // Create a NeatExperiment object with the evaluation scheme.
            var experiment = NeatExperiment <double> .CreateAcyclic(
                "Binary 3-multiplexer",
                evalScheme,
                __DefaultActivationFunctionName.ToString());

            // Read standard neat experiment json config and use it configure the experiment.
            if (configJobj != null)
            {
                NeatExperimentJsonReader <double> .Read(experiment, configJobj);
            }

            return(experiment);
        }