public ArtificialNeuralNetwork(int inputNumberOfNeurons, int hideNumberOfNeurons, int outputNumberOfNeurons) { m_input = new ANN_Layer(inputNumberOfNeurons, "Input"); m_hide = new ANN_Layer(hideNumberOfNeurons, "Hide"); m_output = new ANN_Layer(outputNumberOfNeurons, "Output"); m_input.AddRelations(null, m_hide); m_hide.AddRelations(m_input, m_output); m_output.AddRelations(m_hide, null); m_input.RamdomWeight(); m_hide.RamdomWeight(); }
public void AddRelations(ANN_Layer parent, ANN_Layer child) { if (parent != null) { m_parentLayer = parent; m_numberOfParentNeurons = parent.m_numberOfNeurons; } if (child != null) { m_childLayer = child; m_numberOfChildNeurons = child.m_numberOfNeurons; m_weight = new float[m_numberOfNeurons, m_numberOfChildNeurons]; m_weightsIncrease = new float[m_numberOfNeurons, m_numberOfChildNeurons]; m_biasWeight = new float[m_numberOfChildNeurons]; m_biasValues = new float[m_numberOfChildNeurons]; } }