コード例 #1
0
        /// <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 Single Pole Balancing task.
            var evalScheme = new CartSinglePoleEvaluationScheme();

            // Create a NeatExperiment object with the evaluation scheme,
            // and assign some default settings (these can be overridden by config).
            var experiment = new NeatExperiment <double>("Cart and Pole Balancing (Single Pole)", evalScheme)
            {
                IsAcyclic        = true,
                ActivationFnName = ActivationFunctionId.LogisticSteep.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 Single Pole Balancing task.
            var evalScheme = new CartSinglePoleEvaluationScheme();

            // Create a NeatExperiment object with the evaluation scheme.
            var experiment = NeatExperiment <double> .CreateAcyclic(
                "Cart and Pole Balancing (Single Pole)",
                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);
        }