Пример #1
0
        override public void fire(InputPattern I)
        {
            float [] input = I.getInputPattern();
            double   sum   = 0;

            for (int i = 0; i < inputSynapses.GetLength(0); i++)
            {
                sum += inputSynapses[i].getSynapseWeight() * input[i];
            }
            base.output = (float)sum;
        }
Пример #2
0
        override public void fire(InputPattern I)
        {
            //z = -sqrt(sum(w-p)^2)
            float sum = 0.0F;

            for (int i = 0; i < inputSynapses.Length; i++)
            {
                sum += (float)Math.Pow(inputSynapses[i].getSynapseWeight() - I.getInputValue(i), 2);
            }
            base.output = (float)(-1 * Math.Sqrt(sum));
        }
Пример #3
0
        public OutputPattern execute(InputPattern I)
        {
            IEnumerator IEnum = (layerOne.getHiddenLayerNeurons()).GetEnumerator();

            while (IEnum.MoveNext())
            {
                ((HiddenLayerNeuron)IEnum.Current).fire(I);
            }

            float [] x = competitionBox.compete(layerOne);
            I     = new InputPattern(x);
            IEnum = (layerTwo.getOutputNeuronsList()).GetEnumerator();
            OutputPattern o = new OutputPattern(layerTwo.getOutputNeuronsList().Count);
            int           i = 0;

            while (IEnum.MoveNext())
            {
                ((OutputLayerNeuron)IEnum.Current).fire(I);
                o.setOutput(((OutputLayerNeuron)IEnum.Current).getOutput(), i++);
            }
            return(o);
        }
Пример #4
0
 virtual public void fire(InputPattern I)
 {
 }
Пример #5
0
 public OutputPattern feedInput(InputPattern input)
 {
     return(lvqNet.execute(input));
 }