Example #1
0
        public TNeuron Winner(TX X, out double R)
        {
            TNeuron res = this[0];

            R = res.R(X.x);

            for (int i = 1; i < Count; i++)
            {
                double d = this[i].R(X.x);

                if (d < R)
                {
                    R   = d;
                    res = this[i];
                }
            }

            return(res);
        }
Example #2
0
        public int GetClass(TX X)
        {
            if (Count < 1)
            {
                return(-1);
            }

            double R;

            TNeuron Win = Winner(X, out R);

            if (R < Rc)
            {
                return(Map.IndexOf(Win));
            }
            else
            {
                return(-1);
            }
        }