当前位置: 首页>>代码示例>>C#>>正文


C# IMLMethod.GetType方法代码示例

本文整理汇总了C#中IMLMethod.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IMLMethod.GetType方法的具体用法?C# IMLMethod.GetType怎么用?C# IMLMethod.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMLMethod的用法示例。


在下文中一共展示了IMLMethod.GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        /// <summary>
        /// Create a SVM trainer.
        /// </summary>
        ///
        /// <param name="method">The method to use.</param>
        /// <param name="training">The training data to use.</param>
        /// <param name="argsStr">The arguments to use.</param>
        /// <returns>The newly created trainer.</returns>
        public IMLTrain Create(IMLMethod method,
                              IMLDataSet training, String argsStr)
        {
            if (!(method is SupportVectorMachine))
            {
                throw new EncogError(
                    "SVM Train training cannot be used on a method of type: "
                    + method.GetType().FullName);
            }

            double defaultGamma = 1.0d/((SupportVectorMachine) method).InputCount;
            double defaultC = 1.0d;

            IDictionary<String, String> args = ArchitectureParse.ParseParams(argsStr);
            var holder = new ParamsHolder(args);
            double gamma = holder.GetDouble(MLTrainFactory.PropertyGamma,
                                            false, defaultGamma);
            double c = holder.GetDouble(MLTrainFactory.PropertyC, false,
                                        defaultC);

            var result = new SVMTrain((SupportVectorMachine) method, training);
            result.Gamma = gamma;
            result.C = c;
            return result;
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:33,代码来源:SVMFactory.cs

示例2: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string argsStr)
 {
     if (!(method is SupportVectorMachine))
     {
         throw new EncogError("SVM Train training cannot be used on a method of type: " + method.GetType().FullName);
     }
     double defaultValue = 1.0 / ((double) ((SupportVectorMachine) method).InputCount);
     while (true)
     {
         double num4;
         SVMTrain train;
         double num2 = 1.0;
         IDictionary<string, string> theParams = ArchitectureParse.ParseParams(argsStr);
         ParamsHolder holder = new ParamsHolder(theParams);
         double num3 = holder.GetDouble("GAMMA", false, defaultValue);
         do
         {
             num4 = holder.GetDouble("C", false, num2);
             train = new SVMTrain((SupportVectorMachine) method, training) {
                 Gamma = num3
             };
         }
         while (((uint) defaultValue) > uint.MaxValue);
         if ((((uint) num2) + ((uint) num3)) <= uint.MaxValue)
         {
             train.C = num4;
             return train;
         }
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:30,代码来源:SVMFactory.cs

示例3: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string args)
 {
     if (!(method is BasicPNN))
     {
         throw new EncogError("PNN training cannot be used on a method of type: " + method.GetType().FullName);
     }
     return new TrainBasicPNN((BasicPNN) method, training);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:PNNTrainFactory.cs

示例4: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string argsStr)
 {
     if (!(method is SOMNetwork))
     {
         throw new EncogError("Cluster SOM training cannot be used on a method of type: " + method.GetType().FullName);
     }
     return new SOMClusterCopyTraining((SOMNetwork) method, training);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:ClusterSOMFactory.cs

示例5: NetworkSize

 public static int NetworkSize(IMLMethod network)
 {
     if (!(network is IMLEncodable))
     {
         throw new NeuralNetworkError("This machine learning method cannot be encoded:" + network.GetType().FullName);
     }
     return ((IMLEncodable) network).EncodedArrayLength();
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:NetworkCODEC.cs

示例6: ArrayToNetwork

 public static void ArrayToNetwork(double[] array, IMLMethod network)
 {
     if (!(network is IMLEncodable))
     {
         throw new NeuralNetworkError("This machine learning method cannot be encoded:" + network.GetType().FullName);
     }
     ((IMLEncodable) network).DecodeFromArray(array);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:NetworkCODEC.cs

示例7: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string args)
 {
     if (!(method is BasicNetwork))
     {
         throw new EncogError("SCG training cannot be used on a method of type: " + method.GetType().FullName);
     }
     return new ScaledConjugateGradient((BasicNetwork) method, training);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:SCGFactory.cs

示例8: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string args)
 {
     if (!(method is RBFNetwork))
     {
         throw new EncogError("RBF-SVD training cannot be used on a method of type: " + method.GetType().FullName);
     }
     return new SVDTraining((RBFNetwork) method, training);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:RBFSVDFactory.cs

示例9: ArrayToNetwork

 /// <summary>
 /// Use an array to populate the memory of the neural network.
 /// </summary>
 ///
 /// <param name="array">An array of doubles.</param>
 /// <param name="network">The network to encode.</param>
 public static void ArrayToNetwork(double[] array,
     IMLMethod network)
 {
     if (network is IMLEncodable)
     {
         ((IMLEncodable) network).DecodeFromArray(array);
         return;
     }
     throw new NeuralNetworkError(Error
                                  + network.GetType().FullName);
 }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:17,代码来源:NetworkCODEC.cs

示例10: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string argsStr)
 {
     if (method is IContainsFlat)
     {
         ParamsHolder holder = new ParamsHolder(ArchitectureParse.ParseParams(argsStr));
         double initialUpdate = holder.GetDouble("INIT_UPDATE", false, 0.1);
         double maxStep = holder.GetDouble("MAX_STEP", false, 50.0);
         if ((((uint) initialUpdate) - ((uint) maxStep)) >= 0)
         {
             return new ResilientPropagation((IContainsFlat) method, training, initialUpdate, maxStep);
         }
     }
     throw new EncogError("RPROP training cannot be used on a method of type: " + method.GetType().FullName);
 }
开发者ID:neismit,项目名称:emds,代码行数:14,代码来源:RPROPFactory.cs

示例11: Create

        /// <summary>
        /// Create a LMA trainer.
        /// </summary>
        ///
        /// <param name="method">The method to use.</param>
        /// <param name="training">The training data to use.</param>
        /// <param name="argsStr">The arguments to use.</param>
        /// <returns>The newly created trainer.</returns>
        public IMLTrain Create(IMLMethod method,
            IMLDataSet training, String argsStr)
        {
            if (!(method is BasicNetwork))
            {
                throw new EncogError(
                    "LMA training cannot be used on a method of type: "
                    + method.GetType().FullName);
            }

            IDictionary<String, String> args = ArchitectureParse.ParseParams(argsStr);
            var holder = new ParamsHolder(args);

            var result = new LevenbergMarquardtTraining(
                (BasicNetwork) method, training);
            return result;
        }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:25,代码来源:LMAFactory.cs

示例12: Create

        /// <summary>
        /// Create a LMA trainer.
        /// </summary>
        ///
        /// <param name="method">The method to use.</param>
        /// <param name="training">The training data to use.</param>
        /// <param name="argsStr">The arguments to use.</param>
        /// <returns>The newly created trainer.</returns>
        public IMLTrain Create(IMLMethod method,
                              IMLDataSet training, String argsStr)
        {
            if (!(method is BasicNetwork))
            {
                throw new EncogError(
                    "LMA training cannot be used on a method of type: "
                    + method.GetType().FullName);
            }

            IDictionary<String, String> args = ArchitectureParse.ParseParams(argsStr);
            var holder = new ParamsHolder(args);
            bool useReg = holder.GetBoolean(
                MLTrainFactory.PropertyBayesianRegularization, false, false);

            var result = new LevenbergMarquardtTraining(
                (BasicNetwork) method, training) {UseBayesianRegularization = useReg};
            return result;
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:27,代码来源:LMAFactory.cs

示例13: Create

        /// <summary>
        /// Create a RPROP trainer.
        /// </summary>
        ///
        /// <param name="method">The method to use.</param>
        /// <param name="training">The training data to use.</param>
        /// <param name="argsStr">The arguments to use.</param>
        /// <returns>The newly created trainer.</returns>
        public IMLTrain Create(IMLMethod method,
                              IMLDataSet training, String argsStr)
        {
            if (!(method is IContainsFlat))
            {
                throw new EncogError(
                    "RPROP training cannot be used on a method of type: "
                    + method.GetType().FullName);
            }

            IDictionary<String, String> args = ArchitectureParse.ParseParams(argsStr);
            var holder = new ParamsHolder(args);
            double initialUpdate = holder.GetDouble(
                MLTrainFactory.PropertyInitialUpdate, false,
                RPROPConst.DefaultInitialUpdate);
            double maxStep = holder.GetDouble(
                MLTrainFactory.PropertyMaxStep, false,
                RPROPConst.DefaultMaxStep);

            return new ResilientPropagation((IContainsFlat) method, training,
                                            initialUpdate, maxStep);
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:30,代码来源:RPROPFactory.cs

示例14: Create

 public IMLTrain Create(IMLMethod method, IMLDataSet training, string argsStr)
 {
     bool flag;
     LevenbergMarquardtTraining training3;
     if (method is BasicNetwork)
     {
         flag = new ParamsHolder(ArchitectureParse.ParseParams(argsStr)).GetBoolean("BAYES_REG", false, false);
         training3 = new LevenbergMarquardtTraining((BasicNetwork) method, training);
         if (3 == 0)
         {
             LevenbergMarquardtTraining training2;
             return training2;
         }
     }
     else if (0 == 0)
     {
         throw new EncogError("LMA training cannot be used on a method of type: " + method.GetType().FullName);
     }
     training3.UseBayesianRegularization = flag;
     if (0 == 0)
     {
     }
     return training3;
 }
开发者ID:neismit,项目名称:emds,代码行数:24,代码来源:LMAFactory.cs

示例15: NetworkToArray

 public static double[] NetworkToArray(IMLMethod network)
 {
     int num = NetworkSize(network);
     if (!(network is IMLEncodable))
     {
         throw new NeuralNetworkError("This machine learning method cannot be encoded:" + network.GetType().FullName);
     }
     double[] encoded = new double[num];
     ((IMLEncodable) network).EncodeToArray(encoded);
     return encoded;
 }
开发者ID:neismit,项目名称:emds,代码行数:11,代码来源:NetworkCODEC.cs


注:本文中的IMLMethod.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。