public double Generate(double[] input)
{
double sum = threshold;
for (int i = 0; i < weights.Length; i++)
sum += weights[i] * input[i];
double output = function.Function(sum);
double sample = function.Generate2(output);
this.output = output;
this.sample = sample;
return sample;
}