public void learn() { neuron n_01 = new neuron(); for (int i_0 = 0; i_0 < 4; i_0++) { main_Program.cache[0, 0] = main_Program.test_pattern[i_0, 0]; main_Program.cache[0, 1] = main_Program.test_pattern[i_0, 1]; n_01.neuron_func(); if (main_Program.cache[1, 0] != main_Program.test_pattern[i_0, 2]) // when an error occoured { main_Program.error++; do // fix it { init_class.w += (((2 * main_Program.test_pattern[i_0, 2]) - 1) - ((2 * main_Program.cache[1, 0]) - 1)) * init_class.n; // try n_01.neuron_func(); // apply changes } while (main_Program.cache[1, 0] != main_Program.test_pattern[i_0, 2]); // check } } }
public void neuron_init() { neuron n_01 = new neuron(); }