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


C# BiPolarMLData.GetBoolean方法代码示例

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


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

示例1: ComputeF1

 /// <summary>
 /// Compute the output from the F1 layer.
 /// </summary>
 ///
 /// <param name="input">The input to the F1 layer.</param>
 private void ComputeF1(BiPolarMLData input)
 {
     for (int i = 0; i < _f1Count; i++)
     {
         double sum = _weightsF1ToF2[i, Winner]
                      *((_outputF2.GetBoolean(Winner)) ? 1 : 0);
         double activation = (((input.GetBoolean(i)) ? 1 : 0) + _d1*sum - _b1)
                             /(1 + _a1
                                   *(((input.GetBoolean(i)) ? 1 : 0) + _d1*sum) + _c1);
         _outputF1.SetBoolean(i, activation > 0);
     }
 }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:17,代码来源:ART1.cs

示例2: Display

        public void Display(BiPolarMLData pattern1, BiPolarMLData pattern2)
        {
            int index1 = 0;
            int index2 = 0;

            for (int row = 0; row < HEIGHT; row++)
            {
                var line = new StringBuilder();

                for (int col = 0; col < WIDTH; col++)
                {
                    if (pattern1.GetBoolean(index1++))
                        line.Append('O');
                    else
                        line.Append(' ');
                }

                line.Append("   ->   ");

                for (int col = 0; col < WIDTH; col++)
                {
                    if (pattern2.GetBoolean(index2++))
                        line.Append('O');
                    else
                        line.Append(' ');
                }

                Console.WriteLine(line.ToString());
            }
        }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:30,代码来源:HopfieldAssociate.cs

示例3: ComputeF1

 private void ComputeF1(BiPolarMLData input)
 {
     int i = 0;
     if ((((uint) i) - ((uint) i)) >= 0)
     {
         goto Label_001E;
     }
     Label_001A:
     i++;
     Label_001E:
     if (i >= this._f1Count)
     {
         return;
     }
     double num2 = this._weightsF1ToF2[i, this.Winner] * (this._outputF2.GetBoolean(this.Winner) ? ((double) 1) : ((double) 0));
     double num3 = (((input.GetBoolean(i) ? ((double) 1) : ((double) 0)) + (this._d1 * num2)) - this._b1) / ((1.0 + (this._a1 * ((input.GetBoolean(i) ? ((double) 1) : ((double) 0)) + (this._d1 * num2)))) + this._c1);
     if ((((uint) num2) - ((uint) i)) > uint.MaxValue)
     {
         goto Label_001E;
     }
     this._outputF1.SetBoolean(i, num3 > 0.0);
     goto Label_001A;
 }
开发者ID:neismit,项目名称:emds,代码行数:23,代码来源:ART1.cs

示例4: Magnitude

        /// <summary>
        /// Get the magnitude of the specified input.
        /// </summary>
        ///
        /// <param name="input">The input to calculate the magnitude for.</param>
        /// <returns>The magnitude of the specified pattern.</returns>
        public double Magnitude(BiPolarMLData input)
        {
            double result;

            result = 0;
            for (int i = 0; i < _f1Count; i++)
            {
                result += (input.GetBoolean(i)) ? 1 : 0;
            }
            return result;
        }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:17,代码来源:ART1.cs

示例5: Magnitude

 public double Magnitude(BiPolarMLData input)
 {
     double num = 0.0;
     int i = 0;
     while (i < this._f1Count)
     {
         num += input.GetBoolean(i) ? ((double) 1) : ((double) 0);
         i++;
         if ((((uint) num) + ((uint) num)) >= 0)
         {
         }
     }
     return num;
 }
开发者ID:neismit,项目名称:emds,代码行数:14,代码来源:ART1.cs

示例6: BipolalToString

        public String BipolalToString(BiPolarMLData data)
        {
            var result = new StringBuilder();

            int j, a, p;

            for (int i = 0; i < (data.Count/BITS_PER_CHAR); i++)
            {
                a = 0;
                p = 1;
                for (j = 0; j < BITS_PER_CHAR; j++)
                {
                    if (data.GetBoolean(i*BITS_PER_CHAR + j))
                        a += p;

                    p *= 2;
                }
                result.Append((char) (a + FIRST_CHAR));
            }


            return result.ToString();
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:23,代码来源:BidirectionalAssociativeMemory.cs

示例7: DisplayTour

        private String DisplayTour(BiPolarMLData data)
        {
            var result = new StringBuilder();

            int n1, n2;
            bool first;

            for (n1 = 0; n1 < NUM_CITIES; n1++)
            {
                first = true;
                result.Append("[");
                for (n2 = 0; n2 < NUM_CITIES; n2++)
                {
                    if (data.GetBoolean(n1*NUM_CITIES + n2))
                    {
                        if (first)
                        {
                            first = false;
                            result.Append(n2);
                        }
                        else
                        {
                            result.Append(", " + n2);
                        }
                    }
                }
                result.Append("]");
                if (n1 != NUM_CITIES - 1)
                {
                    result.Append(" -> ");
                }
            }
            return result.ToString();
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:34,代码来源:BoltzTSP.cs

示例8: LengthOfTour

        public double LengthOfTour(BiPolarMLData data)
        {
            double result;
            int n1, n2, n3;

            result = 0;
            for (n1 = 0; n1 < NUM_CITIES; n1++)
            {
                for (n2 = 0; n2 < NUM_CITIES; n2++)
                {
                    if (data.GetBoolean(((n1)%NUM_CITIES)*NUM_CITIES + n2))
                        break;
                }
                for (n3 = 0; n3 < NUM_CITIES; n3++)
                {
                    if (data.GetBoolean(((n1 + 1)%NUM_CITIES)*NUM_CITIES + n3))
                        break;
                }
                result += distance[n2][n3];
            }
            return result;
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:22,代码来源:BoltzTSP.cs

示例9: IsValidTour

        public bool IsValidTour(BiPolarMLData data)
        {
            int cities, stops;

            for (int n1 = 0; n1 < NUM_CITIES; n1++)
            {
                cities = 0;
                stops = 0;
                for (int n2 = 0; n2 < NUM_CITIES; n2++)
                {
                    if (data.GetBoolean(n1*NUM_CITIES + n2))
                    {
                        if (++cities > 1)
                            return false;
                    }
                    if (data.GetBoolean(n2*NUM_CITIES + n1))
                    {
                        if (++stops > 1)
                            return false;
                    }
                }
                if ((cities != 1) || (stops != 1))
                    return false;
            }
            return true;
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:26,代码来源:BoltzTSP.cs


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