예제 #1
0
        public override float[] Query(float[] inputValues)
        {
            if (inputValues.Length != Layers[0])
            {
                throw new ArithmeticException("Invalid inputs count");
            }

            Matrix2D inputs_outputs = inputValues.ToMatrix2D().Transpose();

            AllOutputs[0] = inputs_outputs;

            for (int i = 0; i < Layers.Length - 1; i++)
            {
                inputs_outputs    = Matrix2D.ScalerProduct(Weigths[i], inputs_outputs);
                inputs_outputs    = inputs_outputs.ForEach(ActivationFunc);
                AllOutputs[i + 1] = inputs_outputs;
            }

            float[] outputs = inputs_outputs.ToSingleArray();

            return(outputs);
        }