Пример #1
0
        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);
        }
Пример #2
0
        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;
        }
Пример #3
0
 public Neuron(ThresholdFunction.Function Function, double[] Params)
 {
     SetFunctionAndParams(Function, Params);
 }