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


C# BiPolarMLData.SetBoolean方法代码示例

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


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

示例1: Compute

        /// <summary>
        /// Note: for Hopfield networks, you will usually want to call the "run"
        /// method to compute the output.
        /// This method can be used to copy the input data to the current state. A
        /// single iteration is then run, and the new current state is returned.
        /// </summary>
        ///
        /// <param name="input">The input pattern.</param>
        /// <returns>The new current state.</returns>
        public override sealed IMLData Compute(IMLData input)
        {
            var result = new BiPolarMLData(input.Count);
            EngineArray.ArrayCopy(input.Data, CurrentState.Data);
            Run();

            for (int i = 0; i < CurrentState.Count; i++)
            {
                result.SetBoolean(i,
                                  BiPolarUtil.Double2bipolar(CurrentState[i]));
            }
            EngineArray.ArrayCopy(CurrentState.Data, result.Data);
            return result;
        }
开发者ID:neismit,项目名称:emds,代码行数:23,代码来源:HopfieldNetwork.cs

示例2: ConvertPattern

 public BiPolarMLData ConvertPattern(String[][] data, int index)
 {
     int resultIndex = 0;
     var result = new BiPolarMLData(WIDTH*HEIGHT);
     for (int row = 0; row < HEIGHT; row++)
     {
         for (int col = 0; col < WIDTH; col++)
         {
             char ch = data[index][row][col];
             result.SetBoolean(resultIndex++, ch == 'O');
         }
     }
     return result;
 }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:14,代码来源:HopfieldAssociate.cs

示例3: GetOutput

 /// <summary>
 /// Copy the output from the network to another object.
 /// </summary>
 ///
 /// <param name="output">The target object for the output from the network.</param>
 private void GetOutput(BiPolarMLData output)
 {
     for (int i = 0; i < _f2Count; i++)
     {
         output.SetBoolean(i, _outputF2.GetBoolean(i));
     }
 }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:12,代码来源:ART1.cs

示例4: Classify

        /// <summary>
        /// Classify the input data to a class number.
        /// </summary>
        ///
        /// <param name="input">The input data.</param>
        /// <returns>The class that the data belongs to.</returns>
        public int Classify(IMLData input)
        {
            var input2 = new BiPolarMLData(_f1Count);
            var output = new BiPolarMLData(_f2Count);

            if (input.Count != input2.Count)
            {
                throw new NeuralNetworkError("Input array size does not match.");
            }

            for (int i = 0; i < input2.Count; i++)
            {
                input2.SetBoolean(i, input[i] > 0);
            }

            Compute(input2, output);

            return HasWinner ? Winner : -1;
        }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:25,代码来源:ART1.cs

示例5: Classify

 public int Classify(IMLData input)
 {
     int num;
     BiPolarMLData data = new BiPolarMLData(this._f1Count);
     BiPolarMLData output = new BiPolarMLData(this._f2Count);
     if (input.Count != data.Count)
     {
         throw new NeuralNetworkError("Input array size does not match.");
     }
     goto Label_0022;
     Label_0013:
     return -1;
     Label_0022:
     num = 0;
     while (num < data.Count)
     {
         data.SetBoolean(num, input[num] > 0.0);
         num++;
     }
     this.Compute(data, output);
     if (!this.HasWinner)
     {
         goto Label_0013;
     }
     return this.Winner;
     if (-1 == 0)
     {
         goto Label_0013;
     }
     goto Label_0022;
 }
开发者ID:neismit,项目名称:emds,代码行数:31,代码来源:ART1.cs

示例6: StringToBipolar

        public BiPolarMLData StringToBipolar(String str)
        {
            var result = new BiPolarMLData(str.Length*BITS_PER_CHAR);
            int currentIndex = 0;
            for (int i = 0; i < str.Length; i++)
            {
                char ch = char.ToUpper(str[i]);
                int idx = ch - FIRST_CHAR;

                int place = 1;
                for (int j = 0; j < BITS_PER_CHAR; j++)
                {
                    bool value = (idx & place) > 0;
                    result.SetBoolean(currentIndex++, value);
                    place *= 2;
                }
            }
            return result;
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:19,代码来源:BidirectionalAssociativeMemory.cs

示例7: 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


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