Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Mutate()
- {
- for (int i = 0; i < brain.Length; i++)
- {
- if(Program.rand.Next(1,(20 - Program.a.mutationRate.Value)) == 8)brain[i] += Program.rand.Next(1, 100) / 1000;
- }
- }
- public static float[] getOutput(float[] Input, float[] Weights)
- {
- int i = 0;
- float[] Output = new float[Input.Length];
- for (int a = 0; a < Input.Length; a++)
- {
- for (int b = a * Input.Length; b < (a * Input.Length) + Input.Length; b++)
- {
- i++;
- Output[a] += Input[a] * Weights[b] + Program.rand.Next(-1,1);
- }
- }
- return Output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement