Exemplo n.º 1
0
        public static new OutputLayer Make(XmlNode layerNode)
        {
            var layer = new OutputLayer(0);

            layer._neurons.Clear();
            foreach (XmlNode neuronNode in layerNode.SelectNodes("OutputNeuronNeuron"))
            {
                int id = Convert.ToInt32(neuronNode.Attributes["id"].Value);
                layer.AddSingleNeuron(new OutputNeuron(id));
            }

            return layer;
        }
Exemplo n.º 2
0
        private void AssignLayers(XmlDocument doc)
        {
            _layers.Clear();

            _inputLayer = null;
            _outputLayer = null;

            foreach (XmlNode layerNode in doc.SelectNodes("/NeuronNetwork/Layers/NeuronLayer"))
            {
                var layer = NeuronLayer.Make(layerNode);

                if (null == _inputLayer)
                    _inputLayer = layer;

                _layers.Add(layer);
            }
        }
Exemplo n.º 3
0
        private void LoadFromXmlFile(XmlDocument doc)
        {
            _layers.Clear();
            _inputLayer = null;
            _outputLayer = null;

            try
            {
                InitializeFromXml(doc);
                AssignLayers(doc);
                AssignOutputLayer(doc);
                AssignSynapses(doc);
            }
            catch
            {
                Filename = "";
                _layers.Clear();
                _inputLayer = null;
                _outputLayer = null;
                throw;
            }
        }
Exemplo n.º 4
0
 protected void AssignOutputLayer(XmlDocument doc)
 {
     XmlNode outputlayerNode = doc.SelectSingleNode("/NeuronNetwork/Layers/OutputLayer");
     _outputLayer = OutputLayer.Make(outputlayerNode);
     _layers.Add(_outputLayer);
 }