示例#1
0
        public SOMLearning(KohonenNetwork network, int width, int height)
        {
            // check network size
            if (network[0].NeuronsCount != width*height)
            {
                throw new ArgumentException("Invalid network size");
            }

            this.network = network;
            this.width = width;
            this.height = height;
        }
示例#2
0
        public SOMLearning(KohonenNetwork network)
        {
            int neuronsCount = network[0].NeuronsCount;
            width = (int)Math.Sqrt(neuronsCount);

            this.Neighborhood = new TwoDimensionalNeighborhood(width);
            this.Conscience = new Conscience(neuronsCount, 0);

            if (width*width != neuronsCount)
            {
                throw new ArgumentException("Invalid network size");
            }

            // ok, we got it
            this.network = network;
            this.width = width;
            this.height = height;
        }