/// <summary> /// Builds the structure of the neural network ready for training and testing /// </summary> public static void BuildStructure(Base inputLayer, Base outputLayer, List<Structure.Node.Base> inputLayerNodes, List<Structure.Node.Base> ouputLayerNodes, Network testNetworkStructure) { for (Int32 i = 0; i < 1; i++) inputLayerNodes.Add(new Structure.Node.Base(inputLayer, new Elliott())); inputLayer.SetNodes(inputLayerNodes); EchoReservoir echoLayer = new EchoReservoir(130, 0.4f, 0, 5, new Elliott()); for (Int32 i = 0; i < 1; i++) ouputLayerNodes.Add(new Output(outputLayer, new Elliott())); outputLayer.SetNodes(ouputLayerNodes); inputLayer.ConnectFowardLayer(echoLayer); echoLayer.ConnectFowardLayer(outputLayer); testNetworkStructure.AddLayer(inputLayer); testNetworkStructure.AddLayer(echoLayer); testNetworkStructure.AddLayer(outputLayer); foreach (Base layer in testNetworkStructure.GetCurrentLayers()) layer.PopulateNodeConnections(); }
/// <summary> /// Builds the structure of the neural network ready for training and testing /// </summary> public static void BuildStructure() { _InputLayer = new Base(); _InputLayerNodes = new List<Structure.Node.Base>(); for (Int32 i = 0; i < 1; i++) _InputLayerNodes.Add(new Structure.Node.Base(_InputLayer, new Elliott())); _InputLayer.SetNodes(_InputLayerNodes); EchoReservoir echoLayer = new EchoReservoir(130, 0.4f, 0, 5, new Elliott()); _OutputLayer = new Base(); _OuputLayerNodes = new List<Structure.Node.Base>(); for (Int32 i = 0; i < 1; i++) _OuputLayerNodes.Add(new Output(_OutputLayer, new Elliott())); _OutputLayer.SetNodes(_OuputLayerNodes); _InputLayer.ConnectFowardLayer(echoLayer); echoLayer.ConnectFowardLayer(_OutputLayer); _TestNetworkStructure.AddLayer(_InputLayer); _TestNetworkStructure.AddLayer(echoLayer); _TestNetworkStructure.AddLayer(_OutputLayer); foreach (Base layer in _TestNetworkStructure.GetCurrentLayers()) layer.PopulateNodeConnections(); }
/// <summary> /// Builds the structure of the neural network ready for training and testing /// </summary> public static void BuildStructure() { _InputLayer = new Base(); _InputLayerNodes = new List<Structure.Node.Base>(); for (Int32 i = 0; i < 1; i++) _InputLayerNodes.Add(new Structure.Node.Base(_InputLayer, new Tanh())); _InputLayer.SetNodes(_InputLayerNodes); EchoReservoir echoLayer = new EchoReservoir(50, 0.4f, 0, 30, new Tanh()); _OutputLayer = new Base(); _OuputLayerNodes = new List<Structure.Node.Base>(); for (Int32 i = 0; i < 1; i++) _OuputLayerNodes.Add(new Output(_OutputLayer, new Tanh())); _OutputLayer.SetNodes(_OuputLayerNodes); _RecurrentLayer = new RecurrentContext(2, new Tanh()); _RecurrentLayer.AddSourceNodes(_OuputLayerNodes); _InputLayer.ConnectFowardLayer(echoLayer); _RecurrentLayer.ConnectFowardLayer(echoLayer); echoLayer.ConnectFowardLayer(_OutputLayer); _TestNetworkStructure.AddLayer(_InputLayer); _TestNetworkStructure.AddLayer(_RecurrentLayer); _TestNetworkStructure.AddLayer(echoLayer); _TestNetworkStructure.AddLayer(_OutputLayer); foreach (Base layer in _TestNetworkStructure.GetCurrentLayers()) layer.PopulateNodeConnections(); ((Structure.Node.RecurrentContext)_RecurrentLayer.GetNodes()[0]).OverrideRateOfUpdate(1); }