//BRAIN HELPERS void simple_train() { //Nothing infront -> Don't do much. NeuralNet.Matrix zeroin = new NeuralNet.Matrix(1, Eye_script.ret_size(), false); NeuralNet.Matrix zerout = new NeuralNet.Matrix(1, 5, false); zerout[0, 0] = 0.5; for (int i = 0; i < 10; i++) { mind.Forward(zeroin); mind.Backward(zerout); } }
void network_train1(bool prnt = false) { for (int i = 0; i < ndset.Rows; i++) { Matrix a = new Matrix(1, 4, new double[, ] { { ndset.Elements[i, 0], ndset.Elements[i, 1], ndset.Elements[i, 2], ndset.Elements[i, 3] } }); //Gets the arguments. Matrix b = net1.Forward(a); if (prnt) { Debug.Log("Training...: Input " + a.ToString() + " Target: " + ndset.Elements[i, 4] + " Output: " + b.ToString()); } net1.Backward(new Matrix(1, 1, new double[, ] { { ndset.Elements[i, 4] } })); } }