• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IMLData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IMLData的典型用法代码示例。如果您正苦于以下问题:C# IMLData类的具体用法?C# IMLData怎么用?C# IMLData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IMLData类属于命名空间,在下文中一共展示了IMLData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DetermineTreeType

        public int DetermineTreeType(OutputEquilateral eqField, IMLData output)
        {
            int result;

            if (eqField != null)
            {
                result = eqField.Equilateral.Decode(output.Data);
            }
            else
            {
                double maxOutput = Double.NegativeInfinity;
                result = -1;

                for (int i = 0; i < output.Count; i++)
                {
                    if (output[i] > maxOutput)
                    {
                        maxOutput = output[i];
                        result = i;
                    }
                }
            }

            return result;
        }
开发者ID:firestrand,项目名称:encog-dotnet-core,代码行数:25,代码来源:Evaluate.cs


示例2: Compute

 public IMLData Compute(IMLData input)
 {
     int num;
     Matrix col;
     Matrix matrix2;
     IMLData data = new BasicMLData(this.OutputCount);
     if (0 == 0)
     {
         goto Label_003F;
     }
     Label_000F:
     matrix2 = Matrix.CreateRowMatrix(input.Data);
     if (3 == 0)
     {
         goto Label_003F;
     }
     data[num] = MatrixMath.DotProduct(matrix2, col);
     num++;
     Label_0034:
     if (num < this.OutputCount)
     {
         col = this._weights.GetCol(num);
         goto Label_000F;
     }
     return data;
     Label_003F:
     num = 0;
     goto Label_0034;
 }
开发者ID:neismit,项目名称:emds,代码行数:29,代码来源:SOMNetwork.cs


示例3: x3342cd5bc15ae07b

 private void x3342cd5bc15ae07b(int x7079b5ea66d0bae1, IMLData xcdaeea7afaf570ff)
 {
     for (int i = 0; i < this._x87a7fc6a72741c2e.InputCount; i++)
     {
         this._x87a7fc6a72741c2e.Weights[i, x7079b5ea66d0bae1] = xcdaeea7afaf570ff[i];
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:7,代码来源:SOMClusterCopyTraining.cs


示例4: Compute

 public override sealed IMLData Compute(IMLData input)
 {
     int num;
     BiPolarMLData data = new BiPolarMLData(input.Count);
     if (0 == 0)
     {
         if (((uint) num) <= uint.MaxValue)
         {
             if (3 == 0)
             {
                 return data;
             }
             goto Label_0053;
         }
     }
     else
     {
         goto Label_0053;
     }
     Label_003B:
     EngineArray.ArrayCopy(base.CurrentState.Data, data.Data);
     return data;
     Label_0053:
     EngineArray.ArrayCopy(input.Data, base.CurrentState.Data);
     this.Run();
     for (num = 0; num < base.CurrentState.Count; num++)
     {
         data.SetBoolean(num, BiPolarUtil.Double2bipolar(base.CurrentState[num]));
     }
     goto Label_003B;
 }
开发者ID:neismit,项目名称:emds,代码行数:31,代码来源:HopfieldNetwork.cs


示例5: CopyInputPattern

 /// <summary>
 /// Copy the specified input pattern to the weight matrix. This causes an
 /// output neuron to learn this pattern "exactly". This is useful when a
 /// winner is to be forced.
 /// </summary>
 ///
 /// <param name="outputNeuron">The output neuron to set.</param>
 /// <param name="input">The input pattern to copy.</param>
 private void CopyInputPattern(int outputNeuron, IMLData input)
 {
     for (int inputNeuron = 0; inputNeuron < _network.InputCount; inputNeuron++)
     {
         _network.Weights[inputNeuron, outputNeuron] = input[inputNeuron];
     }
 }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:15,代码来源:SOMClusterCopyTraining.cs


示例6: Classify

        /// <summary>
        /// Classify the input into one of the output clusters.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <returns>The cluster it was clasified into.</returns>
        public int Classify(IMLData input)
        {
            if (input.Count > InputCount)
            {
                throw new NeuralNetworkError(
                    "Can't classify SOM with input size of " + InputCount
                    + " with input data of count " + input.Count);
            }

            double[][] m = _weights.Data;
            double minDist = Double.PositiveInfinity;
            int result = -1;

            for (int i = 0; i < OutputCount; i++)
            {
                double dist = EngineArray.EuclideanDistance(input, m[i]);
                if (dist < minDist)
                {
                    minDist = dist;
                    result = i;
                }
            }

            return result;
        }
开发者ID:jongh0,项目名称:MTree,代码行数:30,代码来源:SOMNetwork.cs


示例7: AddPattern

        /// <summary>
        /// Train the neural network for the specified pattern. The neural network
        /// can be trained for more than one pattern. To do this simply call the
        /// train method more than once.
        /// </summary>
        ///
        /// <param name="pattern">The pattern to train for.</param>
        public void AddPattern(IMLData pattern)
        {
            if (pattern.Count != NeuronCount)
            {
                throw new NeuralNetworkError("Network with " + NeuronCount
                                             + " neurons, cannot learn a pattern of size "
                                             + pattern.Count);
            }

            // Create a row matrix from the input, convert boolean to bipolar
            Matrix m2 = Matrix.CreateRowMatrix(pattern.Data);
            // Transpose the matrix and multiply by the original input matrix
            Matrix m1 = MatrixMath.Transpose(m2);
            Matrix m3 = MatrixMath.Multiply(m1, m2);

            // matrix 3 should be square by now, so create an identity
            // matrix of the same size.
            Matrix identity = MatrixMath.Identity(m3.Rows);

            // subtract the identity matrix
            Matrix m4 = MatrixMath.Subtract(m3, identity);

            // now add the calculated matrix, for this pattern, to the
            // existing weight matrix.
            ConvertHopfieldMatrix(m4);
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:33,代码来源:HopfieldNetwork.cs


示例8: CalculateError

 /// <inheritdoc/>
 public void CalculateError(IMLData ideal, double[] actual, double[] error)
 {
     for (int i = 0; i < actual.Length; i++)
     {
         error[i] = ideal[i] - actual[i];
     }
 }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:8,代码来源:LinearErrorFunction.cs


示例9: CalculateBMU

        /// <summary>
        /// Calculate the best matching unit (BMU). This is the output neuron that
        /// has the lowest Euclidean distance to the input vector.
        /// </summary>
        ///
        /// <param name="input">The input vector.</param>
        /// <returns>The output neuron number that is the BMU.</returns>
        public int CalculateBMU(IMLData input)
        {
            int result = 0;

            // Track the lowest distance so far.
            double lowestDistance = Double.MaxValue;

            for (int i = 0; i < _som.OutputCount; i++)
            {
                double distance = CalculateEuclideanDistance(
                    _som.Weights, input, i);

                // Track the lowest distance, this is the BMU.
                if (distance < lowestDistance)
                {
                    lowestDistance = distance;
                    result = i;
                }
            }

            // Track the worst distance, this is the error for the entire network.
            if (lowestDistance > _worstDistance)
            {
                _worstDistance = lowestDistance;
            }

            return result;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:35,代码来源:BestMatchingUnit.cs


示例10: Add

 public override void Add(IMLData data)
 {
     if (!(data is ImageMLData))
     {
         throw new NeuralNetworkError("This data set only supports ImageNeuralData or Image objects.");
     }
     base.Add(data);
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:ImageMLDataSet.cs


示例11: BasicMLDataPair

 public BasicMLDataPair(IMLData input, IMLData ideal, IMLData calced, IMLData error)
 {
     this._significance = 1.0;
     this._input = input;
     this._ideal = ideal;
     this._calced = calced;
     this._error = error;
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:BasicMLDataPair.cs


示例12: LoadedRow

 /// <summary>
 ///     Construct a loaded row from an IMLData.
 /// </summary>
 /// <param name="format">The format to store the numbers in.</param>
 /// <param name="data">The data to use.</param>
 /// <param name="extra">The extra positions to allocate.</param>
 public LoadedRow(CSVFormat format, IMLData data, int extra)
 {
     int count = data.Count;
     _data = new String[count + extra];
     for (int i = 0; i < count; i++)
     {
         _data[i] = format.Format(data[i], 5);
     }
 }
开发者ID:jongh0,项目名称:MTree,代码行数:15,代码来源:LoadedRow.cs


示例13: DenormalizeColumn

        /// <inheritdoc />
        public String DenormalizeColumn(ColumnDefinition colDef, IMLData data,
            int dataColumn)
        {
            double value = data[dataColumn];
            double result = ((colDef.Low - colDef.High)*value
                             - _normalizedHigh*colDef.Low + colDef.High
                             *_normalizedLow)
                            /(_normalizedLow - _normalizedHigh);

            // typically caused by a number that should not have been normalized
            // (i.e. normalization or actual range is infinitely small.
            if (Double.IsNaN(result))
            {
                return "" + (((_normalizedHigh - _normalizedLow)/2) + _normalizedLow);
            }
            return "" + result;
        }
开发者ID:amitla,项目名称:encog-dotnet-core,代码行数:18,代码来源:RangeNormalizer.cs


示例14: DenormalizeColumn

        /// <inheritdoc />
        public String DenormalizeColumn(ColumnDefinition colDef, IMLData data,
            int dataColumn)
        {
            double bestValue = Double.NegativeInfinity;
            int bestIndex = 0;

            for (int i = 0; i < data.Count; i++)
            {
                double d = data[dataColumn + i];
                if (d > bestValue)
                {
                    bestValue = d;
                    bestIndex = i;
                }
            }

            return colDef.Classes[bestIndex];
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:19,代码来源:OneOfNNormalizer.cs


示例15: BasicMLComplexData

 /// <summary>
 /// Construct a new BasicMLData object from an existing one. This makes a
 /// copy of an array. If MLData is not complex, then only reals will be 
 /// created. 
 /// </summary>
 /// <param name="d">The object to be copied.</param>
 public BasicMLComplexData(IMLData d)
 {
     if (d is IMLComplexData)
     {
         var c = (IMLComplexData) d;
         for (int i = 0; i < d.Count; i++)
         {
             _data[i] = new ComplexNumber(c.GetComplexData(i));
         }
     }
     else
     {
         for (int i = 0; i < d.Count; i++)
         {
             _data[i] = new ComplexNumber(d[i], 0);
         }
     }
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:24,代码来源:BasicMLComplexData.cs


示例16: DenormalizeColumn

        /// <inheritdoc />
        public String DenormalizeColumn(ColumnDefinition colDef, IMLData data,
            int dataColumn)
        {
            double high = colDef.Classes.Count;
            double low = 0;

            double value = data[dataColumn];
            double result = ((low - high)*value - _normalizedHigh*low + high
                             *_normalizedLow)
                            /(_normalizedLow - _normalizedHigh);

            // typically caused by a number that should not have been normalized
            // (i.e. normalization or actual range is infinitely small.
            if (Double.IsNaN(result))
            {
                return colDef.Classes[0];
            }
            return colDef.Classes[(int) result];
        }
开发者ID:amitla,项目名称:encog-dotnet-core,代码行数:20,代码来源:RangeOrdinal.cs


示例17: AddPattern

 public void AddPattern(IMLData pattern)
 {
     object[] objArray;
     if (pattern.Count != base.NeuronCount)
     {
         objArray = new object[4];
         if (0 == 0)
         {
             objArray[0] = "Network with ";
             do
             {
                 if (0 != 0)
                 {
                     return;
                 }
             }
             while (0 != 0);
             objArray[1] = base.NeuronCount;
             objArray[2] = " neurons, cannot learn a pattern of size ";
             objArray[3] = pattern.Count;
         }
     }
     else
     {
         Matrix b = Matrix.CreateRowMatrix(pattern.Data);
         Matrix a = MatrixMath.Multiply(MatrixMath.Transpose(b), b);
         Matrix matrix4 = MatrixMath.Identity(a.Rows);
         Matrix delta = MatrixMath.Subtract(a, matrix4);
         this.ConvertHopfieldMatrix(delta);
         if (0 == 0)
         {
             return;
         }
     }
     throw new NeuralNetworkError(string.Concat(objArray));
 }
开发者ID:neismit,项目名称:emds,代码行数:36,代码来源:HopfieldNetwork.cs


示例18: Write

 /// <summary>
 /// Write the data from an IMLData
 /// </summary>
 /// <param name="v">The array to write.</param>
 public void Write(IMLData v)
 {
     try
     {
         for(int i = 0; i < v.Count; i++)
         {
             _binaryWriter.Write(v[i]);
         }
     }
     catch(IOException ex)
     {
         throw new BufferedDataError(ex);
     }
 }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:18,代码来源:EncogEGBFile.cs


示例19: MaxInArray

        private double MaxInArray(IMLData result)
        {
            var array = new double[Network.OutputSize];
            result.CopyTo(array, 0, Network.OutputSize - 1);

            var maxValue = array.Max();
            var maxIndex = array.ToList().IndexOf(maxValue);

            return maxIndex + 1;
        }
开发者ID:dobrybajer,项目名称:NeuralNetworks,代码行数:10,代码来源:ProblemBase.cs


示例20: Compute

        /// <summary>
        ///     Compute the output from the input MLData. The individual values of the
        ///     input will be mapped to the variables defined in the context. The order
        ///     is the same between the input and the defined variables. The input will
        ///     be mapped to the appropriate types. Enums will use their ordinal number.
        ///     The result will be a single number MLData.
        /// </summary>
        /// <param name="input">The input to the program.</param>
        /// <returns>A single numer MLData.</returns>
        public IMLData Compute(IMLData input)
        {
            if (input.Count != InputCount)
            {
                throw new EACompileError("Invalid input count.");
            }

            for (int i = 0; i < input.Count; i++)
            {
                _variables.SetVariable(i, input[i]);
            }

            ExpressionValue v = RootNode.Evaluate();
            VariableMapping resultMapping = ResultType;

            var result = new BasicMLData(1);
            bool success = false;

            switch (resultMapping.VariableType)
            {
                case EPLValueType.FloatingType:
                    if (v.IsNumeric)
                    {
                        result.Data[0] = v.ToFloatValue();
                        success = true;
                    }
                    break;
                case EPLValueType.StringType:
                    result.Data[0] = v.ToFloatValue();
                    success = true;
                    break;
                case EPLValueType.BooleanType:
                    if (v.IsBoolean)
                    {
                        result.Data[0] = v.ToBooleanValue() ? 1.0 : 0.0;
                        success = true;
                    }
                    break;
                case EPLValueType.IntType:
                    if (v.IsNumeric)
                    {
                        result[0] = v.ToIntValue();
                        success = true;
                    }
                    break;
                case EPLValueType.EnumType:
                    if (v.IsEnum)
                    {
                        result.Data[0] = v.ToIntValue();
                        success = true;
                    }
                    break;
            }

            if (!success)
            {
                throw new EARuntimeError("EncogProgram produced "
                                         + v.ExprType.ToString() + " but "
                                         + resultMapping.VariableType.ToString()
                                         + " was expected.");
            }

            return result;
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:73,代码来源:EncogProgram.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMLDataSet类代码示例发布时间:2022-05-24
下一篇:
C# IMAPSimulator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap