public double GetOutput(double[] input)
        {
            if (input.Length != InputSize)
            {
                throw new ArgumentException("This neuron accepts exactly " + InputSize + " numbers.");
            }

            return(_function.ValueAt(input));
        }
Ejemplo n.º 2
0
        public double GetOutput(double[] input, int position, double[] variables)
        {
            if (variables == null)
            {
                throw new ArgumentException("This neuron requires variables for activation function.");
            }

            if (variables.Length != VariableSize)
            {
                throw new ArgumentException("This neuron accepts exactly " + VariableSize + " variables.");
            }

            if (input.Length != InputSize)
            {
                throw new ArgumentException("This neuron accepts exactly " + InputSize + " iputs.");
            }

            return(input[0] * _function.ValueAt(variables));
        }