public void SetNeuronFunction(int neuronNumber, ThresholdFunction.Function function, double[] Params) { if (neuronNumber >= Neurons.Length) { throw new Exception("Neural network has " + Neurons.Length + " neurons. But there was trying to accsess neuron with index " + neuronNumber); } Neurons[neuronNumber].SetFunctionAndParams(function, Params); }
public void SetFunctionAndParams(ThresholdFunction.Function Function, double[] Params) { if (Params.Length != Neural.ThresholdFunction.GetDefaultParams(Function).Length) { throw new ArgumentException("Function needs " + Neural.ThresholdFunction.GetDefaultParams(Function).Length + " parameters. But params count is " + Params.Length); } TransferFunction = Function; this.Params = Params; }
public Neuron(ThresholdFunction.Function Function, double[] Params) { SetFunctionAndParams(Function, Params); }